From 94c93b912fd79ba4e6195fa278c85263031b1bd8 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sun, 30 Mar 2025 17:08:19 +0800 Subject: [PATCH] fix: scroller focus cross monitor --- maomao.c | 4 ++-- preset_config.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/maomao.c b/maomao.c index 281ec60..b685eb7 100644 --- a/maomao.c +++ b/maomao.c @@ -1680,7 +1680,7 @@ Client *direction_select(const Arg *arg) { // 第一次遍历,计算客户端数量 wl_list_for_each(c, &clients, link) { - if (c && (c->tags & c->mon->tagset[c->mon->seltags])) { + if (c && (focus_cross_monitor || c->mon == selmon) && (c->tags & c->mon->tagset[c->mon->seltags])) { last++; } } @@ -1699,7 +1699,7 @@ Client *direction_select(const Arg *arg) { // 第二次遍历,填充 tempClients last = -1; wl_list_for_each(c, &clients, link) { - if (c && (c->tags & c->mon->tagset[c->mon->seltags])) { + if (c && (focus_cross_monitor || c->mon == selmon) && (c->tags & c->mon->tagset[c->mon->seltags])) { last++; tempClients[last] = c; } diff --git a/preset_config.h b/preset_config.h index 119e40a..6518059 100644 --- a/preset_config.h +++ b/preset_config.h @@ -45,6 +45,7 @@ unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ int scroller_structs = 20; float scroller_default_proportion = 0.9; int scoller_focus_center = 0; +int focus_cross_monitor = 0; int bypass_surface_visibility = 0; /* 1 means idle inhibitors will disable idle tracking even if it's