From f328c2721cfa751450aee92d04c2908e9f9cc237 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Wed, 20 May 2026 12:37:37 +0800 Subject: [PATCH] fix: fix ov_no_resize in swallow --- src/animation/client.h | 4 ++++ src/mango.c | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/animation/client.h b/src/animation/client.h index 4d408484..4bb018f9 100644 --- a/src/animation/client.h +++ b/src/animation/client.h @@ -1064,6 +1064,10 @@ void init_fadeout_client(Client *c) { wlr_scene_node_set_enabled(&c->scene->node, true); client_set_border_color(c, config.bordercolor); + if (c->overview_scene_surface) { + wlr_scene_node_destroy(&c->overview_scene_surface->node); + c->overview_scene_surface = NULL; + } fadeout_client->scene = wlr_scene_tree_snapshot(&c->scene->node, layers[LyrFadeOut]); wlr_scene_node_set_enabled(&c->scene->node, false); diff --git a/src/mango.c b/src/mango.c index 7128c908..ea1c928c 100644 --- a/src/mango.c +++ b/src/mango.c @@ -1212,10 +1212,21 @@ void swallow(Client *c, Client *w) { c->master_mfact_per = w->master_mfact_per; c->scroller_proportion = w->scroller_proportion; c->isglobal = w->isglobal; + c->overview_backup_geom = w->overview_backup_geom; /* 调整 w 的邻居指针,让它们指向 c */ c->stack_proportion = w->stack_proportion; + if (w->overview_scene_surface) { + wlr_scene_node_destroy(&w->scene_surface->node); + w->scene_surface = w->overview_scene_surface; + w->overview_scene_surface = NULL; + } + + if (c->mon && c->mon->isoverview) { + overview_backup_surface(c); + } + /* 全局链表替换 */ wl_list_insert(&w->link, &c->link); wl_list_insert(&w->flink, &c->flink); @@ -6074,11 +6085,16 @@ uint32_t want_restore_fullscreen(Client *target_client) { } void overview_backup_surface(Client *c) { + + if (c->overview_scene_surface) { + return; + } + struct wlr_box clip_box; clip_box.x = 0; clip_box.y = 0; - clip_box.width = c->geom.width - 2 * config.borderpx; - clip_box.height = c->geom.height - 2 * config.borderpx; + clip_box.width = c->overview_backup_geom.width - 2 * config.borderpx; + clip_box.height = c->overview_backup_geom.height - 2 * config.borderpx; c->overview_scene_surface = c->scene_surface; wlr_scene_node_set_enabled(&c->scene_surface->node, true);