From dee9717fef2296ba70baa1a1522caf53ee9a4524 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sun, 16 Mar 2025 13:45:14 +0800 Subject: [PATCH] fix: error width for unfocused window in scroller layout --- maomao.c | 4 +++- parse_config.h | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/maomao.c b/maomao.c index 95ac0983..7a5ba248 100644 --- a/maomao.c +++ b/maomao.c @@ -1511,7 +1511,7 @@ applyrules(Client *c) { r->animation_type_close == NULL ? c->animation_type_close : r->animation_type_close; c->scroller_proportion = r->scroller_proportion > 0 ? r->scroller_proportion - : scroller_default_proportion; + : c->scroller_proportion; c->isnoborder = r->isnoborder > 0 ? r->isnoborder : c->isnoborder; newtags = r->tags > 0 ? r->tags | newtags : newtags; i = 0; @@ -5685,6 +5685,7 @@ void scroller(Monitor *m, unsigned int gappo, unsigned int gappi) { for (i = 1; i <= focus_client_index; i++) { c = tempClients[focus_client_index - i]; + target_geom.width = max_client_width * c->scroller_proportion; target_geom.x = tempClients[focus_client_index - i + 1]->geom.x - gappih - target_geom.width; resize(c, target_geom, 0); @@ -5692,6 +5693,7 @@ void scroller(Monitor *m, unsigned int gappo, unsigned int gappi) { for (i = 1; i < n - focus_client_index; i++) { c = tempClients[focus_client_index + i]; + target_geom.width = max_client_width * c->scroller_proportion; target_geom.x = tempClients[focus_client_index + i - 1]->geom.x + gappih + tempClients[focus_client_index + i - 1]->geom.width; resize(c, target_geom, 0); diff --git a/parse_config.h b/parse_config.h index 25417655..f9587212 100644 --- a/parse_config.h +++ b/parse_config.h @@ -480,7 +480,7 @@ FuncType parse_func_name(char *func_name, Arg *arg, char *arg_value) { void parse_config_line(Config *config, const char *line) { char key[256], value[256]; if (sscanf(line, "%[^=]=%[^\n]", key, value) != 2) { - fprintf(stderr, "Error: Invalid line format: %s\n", line); + // fprintf(stderr, "Error: Invalid line format: %s\n", line); return; } @@ -801,7 +801,7 @@ void parse_config_line(Config *config, const char *line) { rule->height = -1; rule->animation_type_open = NULL; rule->animation_type_close = NULL; - rule->scroller_proportion = -1; + rule->scroller_proportion = 0; rule->id = NULL; rule->title = NULL; rule->tags = 0;