From ce1879d4173ebb84c662587067f3c67c9b365d6c Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 16 Jun 2026 08:07:54 +0800 Subject: [PATCH] fix: scroller proportion option miss apply in windowrule --- src/layout/arrange.h | 11 +++++++++-- src/mango.c | 12 ++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 0a39b248..23b9d080 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -26,8 +26,15 @@ void set_size_per(Monitor *m, Client *c) { c->stack_inner_per = 1.0f; } - c->scroller_proportion = - m->pertag->scroller_default_proportion[m->pertag->curtag]; + if (!c->iscustom_scroller_proportion) { + c->scroller_proportion = + m->pertag->scroller_default_proportion[m->pertag->curtag]; + } + + if (!c->iscustom_scroller_proportion_single) { + c->scroller_proportion_single = + m->pertag->scroller_default_proportion_single[m->pertag->curtag]; + } } void resize_tile_master_horizontal(Client *grabc, bool isdrag, int32_t offsetx, diff --git a/src/mango.c b/src/mango.c index 565a7419..3f8362f4 100644 --- a/src/mango.c +++ b/src/mango.c @@ -381,6 +381,8 @@ struct Client { int32_t is_in_scratchpad; int32_t iscustomsize; int32_t iscustompos; + int32_t iscustom_scroller_proportion; + int32_t iscustom_scroller_proportion_single; int32_t is_scratchpad_show; int32_t isglobal; int32_t isnoborder; @@ -1658,6 +1660,14 @@ void applyrules(Client *c) { c->isfloating = 1; } + if (r->scroller_proportion > 0.0f) { + c->iscustom_scroller_proportion = 1; + } + + if (r->scroller_proportion_single > 0.0f) { + c->iscustom_scroller_proportion_single = 1; + } + // set geometry of floating client if (r->width > 1) @@ -4411,6 +4421,8 @@ void init_client_properties(Client *c) { c->ignore_minimize = 1; c->iscustomsize = 0; c->iscustompos = 0; + c->iscustom_scroller_proportion = 0; + c->iscustom_scroller_proportion_single = 0; c->master_mfact_per = 0.0f; c->master_inner_per = 0.0f; c->stack_inner_per = 0.0f;