From 461dcb6989325a5fd2fdbb75104f1187e37de0b4 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 21 Apr 2026 17:32:57 +0800 Subject: [PATCH] fix: opensilent client should insert fstack tail --- src/mango.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/mango.c b/src/mango.c index b9c77759..a73a71a4 100644 --- a/src/mango.c +++ b/src/mango.c @@ -1569,12 +1569,17 @@ void applyrules(Client *c) { int32_t fullscreen_state_backup = c->isfullscreen || client_wants_fullscreen(c); - setmon(c, mon, newtags, - !c->isopensilent && - !(client_is_x11_popup(c) && client_should_ignore_focus(c)) && - mon && - (!c->istagsilent || !newtags || - newtags & mon->tagset[mon->seltags])); + bool should_init_get_focus = + !c->isopensilent && + !(client_is_x11_popup(c) && client_should_ignore_focus(c)) && mon && + (!c->istagsilent || !newtags || newtags & mon->tagset[mon->seltags]); + + if (!should_init_get_focus) { + wl_list_remove(&c->flink); + wl_list_insert(fstack.prev, &c->flink); + } + + setmon(c, mon, newtags, should_init_get_focus); if (!c->isfloating) { c->old_stack_inner_per = c->stack_inner_per; @@ -4211,6 +4216,7 @@ mapnotify(struct wl_listener *listener, void *data) { } } else wl_list_insert(clients.prev, &c->link); // 尾部入栈 + wl_list_insert(&fstack, &c->flink); applyrules(c);