fix: no animaion can drag and scroller half window not enable

This commit is contained in:
DreamMaoMao 2025-06-14 10:55:14 +08:00
parent 33947c30f2
commit 107c717d9f

View file

@ -1433,33 +1433,31 @@ void client_apply_clip(Client *c) {
bool client_draw_frame(Client *c) { bool client_draw_frame(Client *c) {
if (!c || !client_surface(c)->mapped) if (!c || !client_surface(c)->mapped)
return false; return false;
if (c->isfullscreen) if(c->isfullscreen) {
client_set_opacity(c, 1); client_set_opacity(c, 1);
else if (c == selmon->sel && !c->animation.running) { } else if(c == selmon->sel && !c->animation.running) {
client_set_opacity(c, c->focused_opacity); client_set_opacity(c, c->focused_opacity);
} else if (!c->animation.running) { } else if(!c->animation.running) {
client_set_opacity(c, c->unfocused_opacity); client_set_opacity(c, c->unfocused_opacity);
} }
if (!c->need_output_flush) if (!c->need_output_flush)
return false; return false;
if (animations && c->animation.running) { if (animations && c->animation.running) {
client_animation_next_tick(c); client_animation_next_tick(c);
client_apply_clip(c); client_apply_clip(c);
} else { } else {
if (!c->is_clip_to_hide) wlr_scene_node_set_position(&c->scene->node, c->pending.x, c->pending.y);
wlr_scene_node_set_position(&c->scene->node, c->pending.x, c->animainit_geom = c->animation.initial = c->pending = c->current =
c->pending.y); c->geom;
c->animainit_geom = c->animation.initial = c->pending = c->current = client_apply_clip(c);
c->geom; c->need_output_flush = false;
client_apply_clip(c); }
c->need_output_flush = false; return true;
}
return true;
} }
bool client_draw_fadeout_frame(Client *c) { bool client_draw_fadeout_frame(Client *c) {
@ -5674,18 +5672,18 @@ void resize(Client *c, struct wlr_box geo, int interact) {
c->configure_serial = client_set_size(c, c->geom.width - 2 * c->bw, c->configure_serial = client_set_size(c, c->geom.width - 2 * c->bw,
c->geom.height - 2 * c->bw); c->geom.height - 2 * c->bw);
if (c == grabc) { if (c == grabc) {
c->animation.running = false; c->animation.running = false;
c->need_output_flush = false; c->need_output_flush = false;
c->animainit_geom = c->current = c->pending = c->animation.current = c->animainit_geom = c->current = c->pending = c->animation.current =
c->geom; c->geom;
apply_border(c, c->geom, 0, 0, CORNER_LOCATION_ALL); wlr_scene_node_set_position(&c->scene->node, c->geom.x, c->geom.y);
client_draw_shadow(c); apply_border(c, c->geom, 0, 0, CORNER_LOCATION_ALL);
client_get_clip(c, &clip); client_draw_shadow(c);
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip); client_get_clip(c, &clip);
return; wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip);
} return;
}
// 如果不是工作区切换时划出去的窗口,就让动画的结束位置,就是上面的真实位置和大小 // 如果不是工作区切换时划出去的窗口,就让动画的结束位置,就是上面的真实位置和大小
// c->pending 决定动画的终点一般在其他调用resize的函数的附近设置了 // c->pending 决定动画的终点一般在其他调用resize的函数的附近设置了
if (!c->animation.tagouting && !c->iskilling) { if (!c->animation.tagouting && !c->iskilling) {