feat: add option view_current_to_back

This commit is contained in:
DreamMaoMao 2025-09-15 09:32:36 +08:00
parent 3679e7faba
commit 531eae54cf
3 changed files with 7 additions and 3 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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);