feat: add option focus_cross_monitor

This commit is contained in:
DreamMaoMao 2025-03-25 10:15:54 +08:00
parent 6ec95b52a5
commit 5c7dfa41b5
4 changed files with 9 additions and 2 deletions

View file

@ -19,6 +19,7 @@ animation_curve_close=0.08,0.92,0,1
scroller_structs=20
scroller_default_proportion=0.8
scoller_focus_center=0
focus_cross_monitor=0
scroller_proportion_preset=0.5,0.8,1.0
# Master-Stack Layout Setting (tile,spiral,dwindle)

View file

@ -1697,7 +1697,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++;
}
}
@ -1716,7 +1716,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;
}

View file

@ -93,6 +93,7 @@ typedef struct {
int scroller_structs;
float scroller_default_proportion;
int scoller_focus_center;
int focus_cross_monitor;
float *scroller_proportion_preset;
int scroller_proportion_preset_count;
@ -552,6 +553,8 @@ void parse_config_line(Config *config, const char *line) {
config->scroller_default_proportion = atof(value);
} else if (strcmp(key, "scoller_focus_center") == 0) {
config->scoller_focus_center = atoi(value);
} else if (strcmp(key, "focus_cross_monitor") == 0) {
config->focus_cross_monitor = atoi(value);
} else if (strcmp(key, "scroller_proportion_preset") == 0) {
// 1. 统计 value 中有多少个逗号,确定需要解析的浮点数个数
int count = 0; // 初始化为 0
@ -1130,6 +1133,7 @@ void override_config(void) {
scroller_structs = config.scroller_structs;
scroller_default_proportion = config.scroller_default_proportion;
scoller_focus_center = config.scoller_focus_center;
focus_cross_monitor = config.focus_cross_monitor;
new_is_master = config.new_is_master;
default_mfact = config.default_mfact;
@ -1208,6 +1212,7 @@ void set_value_default() {
config.scroller_structs = 20;
config.scroller_default_proportion = 0.9;
config.scoller_focus_center = 0;
config.focus_cross_monitor = 0;
config.bypass_surface_visibility =
0; /* 1 means idle inhibitors will disable idle tracking even if it's

View file

@ -46,6 +46,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