Skip to content

Commit

Permalink
limit icon size when we have a fixed width
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha kruse committed Sep 17, 2018
1 parent fab2543 commit 29fba6e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/settings.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,17 @@ void load_settings(char *cmdline_config_path)
"Scale larger icons down to this size, set to 0 to disable"
);

// restrict the icon size to a reasonable limit if we have a fixed width.
// Otherwise the layout will be broken by too large icons.
// See https://github.com/dunst-project/dunst/issues/540
if (settings.geometry.width_set) {
int icon_size_limit = settings.geometry.w / 2;
if (settings.max_icon_size == 0 ||
settings.max_icon_size > icon_size_limit) {
settings.max_icon_size = icon_size_limit;
}
}

// If the deprecated icon_folders option is used,
// read it and generate its usage string.
if (ini_is_set("global", "icon_folders") || cmdline_is_set("-icon_folders")) {
Expand Down

0 comments on commit 29fba6e

Please sign in to comment.