mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-03 06:46:38 -04:00
add tag_orientation switch, refactor focusdir dispatcher to properly support it with focus_cross_tag and focus_cross_monitor
This commit is contained in:
parent
f8fa7a856c
commit
5baff24b0e
4 changed files with 26 additions and 8 deletions
|
|
@ -82,6 +82,7 @@ sloppyfocus=1
|
||||||
warpcursor=1
|
warpcursor=1
|
||||||
focus_cross_monitor=0
|
focus_cross_monitor=0
|
||||||
focus_cross_tag=0
|
focus_cross_tag=0
|
||||||
|
tag_orientation=0
|
||||||
enable_floating_snap=0
|
enable_floating_snap=0
|
||||||
snap_distance=30
|
snap_distance=30
|
||||||
cursor_size=24
|
cursor_size=24
|
||||||
|
|
|
||||||
|
|
@ -217,6 +217,7 @@ typedef struct {
|
||||||
int32_t exchange_cross_monitor;
|
int32_t exchange_cross_monitor;
|
||||||
int32_t scratchpad_cross_monitor;
|
int32_t scratchpad_cross_monitor;
|
||||||
int32_t focus_cross_tag;
|
int32_t focus_cross_tag;
|
||||||
|
int32_t tag_orientation;
|
||||||
int32_t view_current_to_back;
|
int32_t view_current_to_back;
|
||||||
int32_t no_border_when_single;
|
int32_t no_border_when_single;
|
||||||
int32_t no_radius_when_single;
|
int32_t no_radius_when_single;
|
||||||
|
|
@ -1351,6 +1352,8 @@ bool parse_option(Config *config, char *key, char *value) {
|
||||||
config->scratchpad_cross_monitor = atoi(value);
|
config->scratchpad_cross_monitor = atoi(value);
|
||||||
} else if (strcmp(key, "focus_cross_tag") == 0) {
|
} else if (strcmp(key, "focus_cross_tag") == 0) {
|
||||||
config->focus_cross_tag = atoi(value);
|
config->focus_cross_tag = atoi(value);
|
||||||
|
} else if (strcmp(key, "tag_orientation") == 0) {
|
||||||
|
config->tag_orientation = atoi(value);
|
||||||
} else if (strcmp(key, "view_current_to_back") == 0) {
|
} else if (strcmp(key, "view_current_to_back") == 0) {
|
||||||
config->view_current_to_back = atoi(value);
|
config->view_current_to_back = atoi(value);
|
||||||
} else if (strcmp(key, "blur") == 0) {
|
} else if (strcmp(key, "blur") == 0) {
|
||||||
|
|
@ -3146,6 +3149,7 @@ void override_config(void) {
|
||||||
exchange_cross_monitor = CLAMP_INT(config.exchange_cross_monitor, 0, 1);
|
exchange_cross_monitor = CLAMP_INT(config.exchange_cross_monitor, 0, 1);
|
||||||
scratchpad_cross_monitor = CLAMP_INT(config.scratchpad_cross_monitor, 0, 1);
|
scratchpad_cross_monitor = CLAMP_INT(config.scratchpad_cross_monitor, 0, 1);
|
||||||
focus_cross_tag = CLAMP_INT(config.focus_cross_tag, 0, 1);
|
focus_cross_tag = CLAMP_INT(config.focus_cross_tag, 0, 1);
|
||||||
|
tag_orientation = CLAMP_INT(config.tag_orientation, 0, 1);
|
||||||
view_current_to_back = CLAMP_INT(config.view_current_to_back, 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);
|
enable_floating_snap = CLAMP_INT(config.enable_floating_snap, 0, 1);
|
||||||
snap_distance = CLAMP_INT(config.snap_distance, 0, 99999);
|
snap_distance = CLAMP_INT(config.snap_distance, 0, 99999);
|
||||||
|
|
@ -3313,6 +3317,7 @@ void set_value_default() {
|
||||||
config.exchange_cross_monitor = exchange_cross_monitor;
|
config.exchange_cross_monitor = exchange_cross_monitor;
|
||||||
config.scratchpad_cross_monitor = scratchpad_cross_monitor;
|
config.scratchpad_cross_monitor = scratchpad_cross_monitor;
|
||||||
config.focus_cross_tag = focus_cross_tag;
|
config.focus_cross_tag = focus_cross_tag;
|
||||||
|
config.tag_orientation = tag_orientation;
|
||||||
config.axis_scroll_factor = axis_scroll_factor;
|
config.axis_scroll_factor = axis_scroll_factor;
|
||||||
config.view_current_to_back = view_current_to_back;
|
config.view_current_to_back = view_current_to_back;
|
||||||
config.single_scratchpad = single_scratchpad;
|
config.single_scratchpad = single_scratchpad;
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ int32_t scroller_prefer_center = 0;
|
||||||
int32_t scroller_prefer_overspread = 1;
|
int32_t scroller_prefer_overspread = 1;
|
||||||
int32_t focus_cross_monitor = 0;
|
int32_t focus_cross_monitor = 0;
|
||||||
int32_t focus_cross_tag = 0;
|
int32_t focus_cross_tag = 0;
|
||||||
|
int32_t tag_orientation = 0;
|
||||||
int32_t exchange_cross_monitor = 0;
|
int32_t exchange_cross_monitor = 0;
|
||||||
int32_t scratchpad_cross_monitor = 0;
|
int32_t scratchpad_cross_monitor = 0;
|
||||||
int32_t view_current_to_back = 0;
|
int32_t view_current_to_back = 0;
|
||||||
|
|
|
||||||
|
|
@ -142,13 +142,24 @@ int32_t focusdir(const Arg *arg) {
|
||||||
warp_cursor(c);
|
warp_cursor(c);
|
||||||
} else {
|
} else {
|
||||||
if (config.focus_cross_tag) {
|
if (config.focus_cross_tag) {
|
||||||
if (arg->i == LEFT || arg->i == UP)
|
if (config.tag_orientation) {
|
||||||
viewtoleft_have_client(&(Arg){0});
|
if (arg->i == DOWN) {
|
||||||
if (arg->i == RIGHT || arg->i == DOWN)
|
viewtoright_have_client(&(Arg){0});
|
||||||
viewtoright_have_client(&(Arg){0});
|
} else if (arg->i == UP) {
|
||||||
} else if (config.focus_cross_monitor) {
|
viewtoleft_have_client(&(Arg){0});
|
||||||
focusmon(arg);
|
} else if (config.focus_cross_monitor) {
|
||||||
}
|
focusmon(arg);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (arg->i == RIGHT) {
|
||||||
|
viewtoright_have_client(&(Arg){0});
|
||||||
|
} else if (arg->i == LEFT) {
|
||||||
|
viewtoleft_have_client(&(Arg){0});
|
||||||
|
} else if (config.focus_cross_monitor) {
|
||||||
|
focusmon(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue