From 0ae91bedb384f04985c0f090cba22975fb13f541 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 17 Jan 2026 12:50:54 +0800 Subject: [PATCH] opt: auto unstack if the direction find is null --- src/dispatch/bind_define.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index d55b998..202afd5 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -1598,8 +1598,19 @@ int32_t scroller_stack(const Arg *arg) { Client *left_c = find_client_by_direction(c, arg, false, true); - if (!left_c) + if (!left_c) { + if (arg->i == LEFT) { + exit_scroller_stack(c); + wl_list_remove(&c->link); + wl_list_insert(&clients, &c->link); + } else { + exit_scroller_stack(c); + wl_list_remove(&c->link); + wl_list_insert(clients.prev, &c->link); + } + arrange(selmon, false, false); return 0; + } if (c->isfullscreen) { setfullscreen(c, 0);