opt: support unstack direction

This commit is contained in:
DreamMaoMao 2026-01-17 12:56:12 +08:00
parent 0ae91bedb3
commit 37b39168c1
2 changed files with 5 additions and 1 deletions

View file

@ -1085,6 +1085,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value,
(*arg).i = parse_direction(arg_value);
} else if (strcmp(func_name, "scroller_unstack") == 0) {
func = scroller_unstack;
(*arg).i = parse_direction(arg_value);
} else {
return NULL;
}

View file

@ -1652,7 +1652,10 @@ int32_t scroller_unstack(const Arg *arg) {
// Insert c after the stack it was in
wl_list_remove(&c->link);
wl_list_insert(&scroller_stack_head->link, &c->link);
if (arg->i == RIGHT)
wl_list_insert(&scroller_stack_head->link, &c->link);
else
wl_list_insert(scroller_stack_head->link.prev, &c->link);
focusclient(c, 1);
arrange(selmon, false, false);