Window switch switched to MIN function and added check for

width being less than 0.
This commit is contained in:
Droc 2024-03-25 19:53:43 -05:00
parent ea35b014b9
commit cb2dcd30be

View file

@ -678,9 +678,8 @@ entry(struct theme *theme, const char *key, const char *value)
theme->osd_width_should_parse_as_percentage = true; theme->osd_width_should_parse_as_percentage = true;
} }
theme->osd_window_switcher_width = atoi(value); theme->osd_window_switcher_width = atoi(value);
if (theme->osd_width_should_parse_as_percentage && if (theme->osd_window_switcher_width < 0) {
theme->osd_window_switcher_width > 100) { theme->osd_window_switcher_width = 0;
theme->osd_window_switcher_width = 100;
} }
} }
if (match_glob(key, "osd.window-switcher.padding")) { if (match_glob(key, "osd.window-switcher.padding")) {
@ -1018,6 +1017,10 @@ post_processing(struct theme *theme)
if (theme->osd_workspace_switcher_boxes_height == 0) { if (theme->osd_workspace_switcher_boxes_height == 0) {
theme->osd_workspace_switcher_boxes_width = 0; theme->osd_workspace_switcher_boxes_width = 0;
} }
if (theme->osd_width_should_parse_as_percentage) {
theme->osd_window_switcher_width =
MIN(theme->osd_window_switcher_width, 100);
}
} }
void void