diff --git a/config.conf b/config.conf index 19fd311..af9443e 100644 --- a/config.conf +++ b/config.conf @@ -20,6 +20,7 @@ scroller_structs=20 scroller_default_proportion=0.8 scroller_focus_center=0 scroller_prefer_center=0 +scroller_default_proportion_single=1.0 scroller_proportion_preset=0.5,0.8,1.0 # Master-Stack Layout Setting (tile,spiral,dwindle) diff --git a/maomao.c b/maomao.c index 41227c4..e799667 100644 --- a/maomao.c +++ b/maomao.c @@ -5969,7 +5969,7 @@ void scroller(Monitor *m, unsigned int gappo, unsigned int gappi) { if (n == 1) { c = tempClients[0]; target_geom.height = m->w.height - 2 * gappov; - target_geom.width = max_client_width * c->scroller_proportion; + target_geom.width = (m->w.width - 2 * gappoh) * scroller_default_proportion_single; target_geom.x = m->w.x + (m->w.width - target_geom.width) / 2; target_geom.y = m->w.y + (m->w.height - target_geom.height) / 2; resize(c, target_geom, 0); diff --git a/parse_config.h b/parse_config.h index 85512a7..e821acd 100644 --- a/parse_config.h +++ b/parse_config.h @@ -102,6 +102,7 @@ typedef struct { int scroller_structs; float scroller_default_proportion; + float scroller_default_proportion_single; int scroller_focus_center; int scroller_prefer_center; int focus_cross_monitor; @@ -552,6 +553,8 @@ void parse_config_line(Config *config, const char *line) { config->scroller_structs = atoi(value); } else if (strcmp(key, "scroller_default_proportion") == 0) { config->scroller_default_proportion = atof(value); + } else if (strcmp(key, "scroller_default_proportion_single") == 0) { + config->scroller_default_proportion_single = atof(value); } else if (strcmp(key, "scroller_focus_center") == 0) { config->scroller_focus_center = atoi(value); } else if (strcmp(key, "scroller_prefer_center") == 0) { @@ -1187,6 +1190,7 @@ void override_config(void) { scroller_structs = config.scroller_structs; scroller_default_proportion = config.scroller_default_proportion; + scroller_default_proportion_single = config.scroller_default_proportion_single; scroller_focus_center = config.scroller_focus_center; focus_cross_monitor = config.focus_cross_monitor; swipe_min_threshold = config.swipe_min_threshold; @@ -1269,6 +1273,7 @@ void set_value_default() { config.scroller_structs = scroller_structs; config.scroller_default_proportion = scroller_default_proportion; + config.scroller_default_proportion_single = scroller_default_proportion_single; config.scroller_focus_center = scroller_focus_center; config.scroller_prefer_center = scroller_prefer_center; config.focus_cross_monitor = focus_cross_monitor; diff --git a/preset_config.h b/preset_config.h index fd95a9d..5964e2c 100644 --- a/preset_config.h +++ b/preset_config.h @@ -45,6 +45,7 @@ unsigned int gappov = 10; /* vert outer gap between windows and screen edge */ int scroller_structs = 20; float scroller_default_proportion = 0.9; +float scroller_default_proportion_single = 1.0; int scroller_focus_center = 0; int scroller_prefer_center = 0; int focus_cross_monitor = 0;