From 531eae54cf1207cd69c5bd80555ad45bfe71283b Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 15 Sep 2025 09:32:36 +0800 Subject: [PATCH] feat: add option view_current_to_back --- src/config/parse_config.h | 7 +++++-- src/config/preset.h | 1 + src/dispatch/bind_define.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/config/parse_config.h b/src/config/parse_config.h index 71027b6..a0b29c3 100644 --- a/src/config/parse_config.h +++ b/src/config/parse_config.h @@ -174,6 +174,7 @@ typedef struct { int edge_scroller_pointer_focus; int focus_cross_monitor; int focus_cross_tag; + int view_current_to_back; int no_border_when_single; int no_radius_when_single; int snap_distance; @@ -969,8 +970,8 @@ void parse_config_line(Config *config, const char *line) { config->focus_cross_monitor = atoi(value); } else if (strcmp(key, "focus_cross_tag") == 0) { config->focus_cross_tag = atoi(value); - } else if (strcmp(key, "focus_cross_tag") == 0) { - config->focus_cross_tag = atoi(value); + } else if (strcmp(key, "view_current_to_back") == 0) { + config->view_current_to_back = atoi(value); } else if (strcmp(key, "blur") == 0) { config->blur = atoi(value); } else if (strcmp(key, "blur_layer") == 0) { @@ -2347,6 +2348,7 @@ void override_config(void) { warpcursor = CLAMP_INT(config.warpcursor, 0, 1); focus_cross_monitor = CLAMP_INT(config.focus_cross_monitor, 0, 1); focus_cross_tag = CLAMP_INT(config.focus_cross_tag, 0, 1); + view_current_to_back = CLAMP_INT(config.view_current_to_back, 0, 1); enable_floating_snap = CLAMP_INT(config.enable_floating_snap, 0, 1); snap_distance = CLAMP_INT(config.snap_distance, 0, 99999); cursor_size = CLAMP_INT(config.cursor_size, 4, 512); @@ -2495,6 +2497,7 @@ void set_value_default() { config.edge_scroller_pointer_focus = edge_scroller_pointer_focus; config.focus_cross_monitor = focus_cross_monitor; config.focus_cross_tag = focus_cross_tag; + config.view_current_to_back = view_current_to_back; config.single_scratchpad = single_scratchpad; config.xwayland_persistence = xwayland_persistence; config.syncobj_enable = syncobj_enable; diff --git a/src/config/preset.h b/src/config/preset.h index 6acdb3b..4df96b1 100644 --- a/src/config/preset.h +++ b/src/config/preset.h @@ -61,6 +61,7 @@ int scroller_focus_center = 0; int scroller_prefer_center = 0; int focus_cross_monitor = 0; int focus_cross_tag = 0; +int view_current_to_back = 1; int no_border_when_single = 0; int no_radius_when_single = 0; int snap_distance = 30; diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 7ac0e24..1030385 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -2,7 +2,7 @@ void bind_to_view(const Arg *arg) { unsigned int target = arg->ui; - if (selmon->pertag->curtag && + if (view_current_to_back && selmon->pertag->curtag && (target & TAGMASK) == (selmon->tagset[selmon->seltags])) { if (selmon->pertag->prevtag) target = 1 << (selmon->pertag->prevtag - 1);