mirror of
https://github.com/vale981/bspwm
synced 2025-03-06 10:11:43 -05:00
Arrange when swapping
This commit is contained in:
parent
12403a5081
commit
7eee047b14
1 changed files with 6 additions and 3 deletions
|
@ -374,11 +374,14 @@ void process_message(char *msg, char *rsp)
|
||||||
if (sscanf(arg, "%X", &uid) > 0)
|
if (sscanf(arg, "%X", &uid) > 0)
|
||||||
remove_rule_by_uid(uid);
|
remove_rule_by_uid(uid);
|
||||||
} else if (strcmp(cmd, "swap") == 0) {
|
} else if (strcmp(cmd, "swap") == 0) {
|
||||||
node_t *last_focus = history_get(mon->desk->history, 1);
|
|
||||||
swap_nodes(mon->desk->focus, last_focus);
|
|
||||||
char *opt = strtok(NULL, TOK_SEP);
|
char *opt = strtok(NULL, TOK_SEP);
|
||||||
swap_option_t o;
|
swap_option_t o;
|
||||||
if (parse_swap_option(opt, &o) && o == SWAP_OPTION_SWAP_FOCUS)
|
if (!parse_swap_option(opt, &o))
|
||||||
|
return;
|
||||||
|
node_t *last_focus = history_get(mon->desk->history, 1);
|
||||||
|
swap_nodes(mon->desk->focus, last_focus);
|
||||||
|
arrange(mon, mon->desk);
|
||||||
|
if (o == SWAP_OPTION_SWAP_FOCUS)
|
||||||
focus_node(mon, mon->desk, last_focus);
|
focus_node(mon, mon->desk, last_focus);
|
||||||
} else if (strcmp(cmd, "alternate") == 0) {
|
} else if (strcmp(cmd, "alternate") == 0) {
|
||||||
focus_node(mon, mon->desk, history_get(mon->desk->history, 1));
|
focus_node(mon, mon->desk, history_get(mon->desk->history, 1));
|
||||||
|
|
Loading…
Add table
Reference in a new issue