From fdd30db0c7a295cedc9765a03a5ece7bc0ee1c09 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 16 Sep 2025 10:13:08 +0800 Subject: [PATCH] fix: fullscrren client shouldn't be effect by other monitor --- src/layout/horizontal.h | 10 ++++++++++ src/layout/vertical.h | 11 +++++++++++ src/mango.c | 17 +++++++++-------- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 01a0af2..275eec8 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -140,6 +140,10 @@ void grid(Monitor *m) { if (n == 1) { wl_list_for_each(c, &clients, link) { + + if (c->mon != m) + continue; + c->bw = m->visible_tiling_clients == 1 && no_border_when_single && smartgaps ? 0 @@ -164,6 +168,9 @@ void grid(Monitor *m) { ch = (m->w.height - 2 * overviewgappo) * 0.65; i = 0; wl_list_for_each(c, &clients, link) { + if (c->mon != m) + continue; + c->bw = m->visible_tiling_clients == 1 && no_border_when_single && smartgaps ? 0 @@ -212,6 +219,9 @@ void grid(Monitor *m) { // 调整每个客户端的位置和大小 i = 0; wl_list_for_each(c, &clients, link) { + + if (c->mon != m) + continue; c->bw = m->visible_tiling_clients == 1 && no_border_when_single && smartgaps ? 0 diff --git a/src/layout/vertical.h b/src/layout/vertical.h index ca23df4..206900d 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -138,6 +138,10 @@ void vertical_grid(Monitor *m) { if (n == 1) { wl_list_for_each(c, &clients, link) { + + if (c->mon != m) + continue; + c->bw = m->visible_tiling_clients == 1 && no_border_when_single && smartgaps ? 0 @@ -162,6 +166,10 @@ void vertical_grid(Monitor *m) { cw = (m->w.width - 2 * overviewgappo) * 0.65; i = 0; wl_list_for_each(c, &clients, link) { + + if (c->mon != m) + continue; + c->bw = m->visible_tiling_clients == 1 && no_border_when_single && smartgaps ? 0 @@ -207,6 +215,9 @@ void vertical_grid(Monitor *m) { i = 0; wl_list_for_each(c, &clients, link) { + if (c->mon != m) + continue; + c->bw = m->visible_tiling_clients == 1 && no_border_when_single && smartgaps ? 0 diff --git a/src/mango.c b/src/mango.c index 89724f0..46f5225 100644 --- a/src/mango.c +++ b/src/mango.c @@ -1245,7 +1245,8 @@ void applyrules(Client *c) { */ wl_list_for_each(fc, &clients, link) if (fc && fc != c && c->tags & fc->tags && - ISFULLSCREEN(fc) && !c->isfloating) { + VISIBLEON(fc, c->mon) && ISFULLSCREEN(fc) && + !c->isfloating) { clear_fullscreen_flag(fc); arrange(c->mon, false); } @@ -4306,9 +4307,9 @@ setfloating(Client *c, int floating) { c->is_in_scratchpad = 0; c->isnamedscratchpad = 0; // 让当前tag中的全屏窗口退出全屏参与平铺 - wl_list_for_each(fc, &clients, link) if (fc && fc != c && - c->tags & fc->tags && - ISFULLSCREEN(fc)) { + wl_list_for_each(fc, &clients, + link) if (fc && fc != c && VISIBLEON(fc, c->mon) && + c->tags & fc->tags && ISFULLSCREEN(fc)) { clear_fullscreen_flag(fc); } } @@ -5064,15 +5065,15 @@ void toggleoverview(const Arg *arg) { // overview到正常视图,还原之前退出的浮动和全屏窗口状态 if (selmon->isoverview) { wl_list_for_each(c, &clients, link) { - if (c && !client_is_unmanaged(c) && + if (c && c->mon == selmon && !client_is_unmanaged(c) && !client_should_ignore_focus(c) && !c->isunglobal) overview_backup(c); } } else { wl_list_for_each(c, &clients, link) { - if (c && !c->iskilling && !client_is_unmanaged(c) && - !c->isunglobal && !client_should_ignore_focus(c) && - client_surface(c)->mapped) + if (c && c->mon == selmon && !c->iskilling && + !client_is_unmanaged(c) && !c->isunglobal && + !client_should_ignore_focus(c) && client_surface(c)->mapped) overview_restore(c, &(Arg){.ui = target}); } }