fix: error node enable when clip

This commit is contained in:
DreamMaoMao 2025-03-25 10:47:38 +08:00
parent 763f523166
commit 60d9c3b23a

View file

@ -1046,9 +1046,7 @@ void apply_border(Client *c, struct wlr_box clip_box, int offsetx,
wlr_scene_node_set_position(&c->border[3]->node, clip_box.width - c->bw,
c->bw);
if ((c->animation.running && c->animation.action != MOVE) ||
(c->istiled && strcmp(c->mon->pertag->ltidxs[c->mon->pertag->curtag]->name,
"scroller") == 0)) {
if (c->istiled) {
if (c->animation.current.x < c->mon->m.x) {
set_rect_size(c->border[2], 0, 0);
} else if (c->animation.current.x + c->animation.current.width >
@ -1107,9 +1105,7 @@ void client_apply_clip(Client *c) {
}
// // make tagout tagin animations not visible in other monitors
if ((c->animation.running && c->animation.action != MOVE) ||
(c->istiled && strcmp(c->mon->pertag->ltidxs[c->mon->pertag->curtag]->name,
"scroller") == 0)) {
if (c->istiled) {
if (c->animation.current.x <= c->mon->m.x) {
offsetx = c->mon->m.x - c->animation.current.x;
clip_box.x = clip_box.x + offsetx;
@ -1133,15 +1129,15 @@ void client_apply_clip(Client *c) {
}
}
animationScale scale_data;
if(clip_box.width <= 0 || clip_box.height <= 0) {
if((clip_box.width <= 0 || clip_box.height <= 0) && (c->istiled)) {
c->is_clip_to_hide = true;
wlr_scene_node_set_enabled(&c->scene->node, false);
return;
} else if(c->is_clip_to_hide) {
} else if(c->is_clip_to_hide && VISIBLEON(c, c->mon)) {
c->is_clip_to_hide = false;
wlr_scene_node_set_enabled(&c->scene->node, true);
}
animationScale scale_data;
scale_data.width = clip_box.width - 2 * c->bw;
scale_data.height = clip_box.height - 2 * c->bw;
wlr_scene_subsurface_tree_set_clip(&c->scene_surface->node, &clip_box);