From 59ca7c0fc1a272bf0c6696c0c8d4bcd2e9f1fa05 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 17 Jan 2026 18:26:44 +0800 Subject: [PATCH] fix: sync scroller_proportion in stack --- src/dispatch/bind_define.h | 3 +++ src/layout/arrange.h | 10 +++++++--- src/layout/horizontal.h | 1 + src/layout/vertical.h | 1 + 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 29fbaf3..79ac35a 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -1634,6 +1634,9 @@ int32_t scroller_stack(const Arg *arg) { stack_tail = stack_tail->next_in_stack; } + Client *stack_head = get_scroll_stack_head(target_client); + c->scroller_proportion = stack_head->scroller_proportion; + // Add c to the stack stack_tail->next_in_stack = c; c->prev_in_stack = stack_tail; diff --git a/src/layout/arrange.h b/src/layout/arrange.h index d348a5d..c166771 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -489,9 +489,13 @@ void resize_tile_scroller(Client *grabc, bool isdrag, int32_t offsetx, grabc->scroller_proportion = new_scroller_proportion; grabc->stack_proportion = new_stack_proportion; - if (grabc->prev_in_stack) { - grabc->prev_in_stack->scroller_proportion = - grabc->scroller_proportion; + + Client *stack_head = get_scroll_stack_head(grabc); + Client *iter = stack_head; + + while(iter) { + iter->scroller_proportion = grabc->scroller_proportion; + iter = iter->next_in_stack; } if (!isdrag) { diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 3848a7e..d629040 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -218,6 +218,7 @@ void arrange_stack(Client *scroller_stack_head, struct wlr_box geometry, Client *iter = scroller_stack_head; while (iter) { stack_size++; + iter->scroller_proportion = scroller_stack_head->scroller_proportion; iter = iter->next_in_stack; } diff --git a/src/layout/vertical.h b/src/layout/vertical.h index 2a85bf5..dbe807a 100644 --- a/src/layout/vertical.h +++ b/src/layout/vertical.h @@ -205,6 +205,7 @@ void arrange_stack_vertical(Client *scroller_stack_head, Client *iter = scroller_stack_head; while (iter) { stack_size++; + iter->scroller_proportion = scroller_stack_head->scroller_proportion; iter = iter->next_in_stack; }