Update theme.c

add check for greater than 100%
This commit is contained in:
droc12345 2024-03-25 19:13:35 -05:00 committed by GitHub
parent 684b1ca527
commit 42f3477502
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -677,6 +677,10 @@ entry(struct theme *theme, const char *key, const char *value)
theme->osd_width_should_parse_as_percentage = true;
}
theme->osd_window_switcher_width = atoi(value);
if (theme->osd_width_should_parse_as_percentage &&
theme->osd_window_switcher_width > 100) {
theme->osd_window_switcher_width = 100;
}
}
if (match_glob(key, "osd.window-switcher.padding")) {
theme->osd_window_switcher_padding = atoi(value);