diff options
Diffstat (limited to 'swaybar/tray/icon.c')
-rw-r--r-- | swaybar/tray/icon.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/swaybar/tray/icon.c b/swaybar/tray/icon.c index 69df3582..c426c3d4 100644 --- a/swaybar/tray/icon.c +++ b/swaybar/tray/icon.c | |||
@@ -412,7 +412,7 @@ static char *find_icon_in_subdir(char *name, char *basedir, char *theme, | |||
412 | #endif | 412 | #endif |
413 | "png", | 413 | "png", |
414 | #if HAVE_GDK_PIXBUF | 414 | #if HAVE_GDK_PIXBUF |
415 | "xpm" | 415 | "xpm" // deprecated |
416 | #endif | 416 | #endif |
417 | }; | 417 | }; |
418 | 418 | ||
@@ -508,21 +508,13 @@ static char *find_icon_with_theme(list_t *basedirs, list_t *themes, char *name, | |||
508 | return icon; | 508 | return icon; |
509 | } | 509 | } |
510 | 510 | ||
511 | char *find_icon_in_dir(char *name, char *dir, int *min_size, int *max_size) { | ||
512 | char *icon = find_icon_in_subdir(name, dir, "", ""); | ||
513 | if (icon) { | ||
514 | *min_size = 1; | ||
515 | *max_size = 512; | ||
516 | } | ||
517 | return icon; | ||
518 | |||
519 | } | ||
520 | |||
521 | static char *find_fallback_icon(list_t *basedirs, char *name, int *min_size, | 511 | static char *find_fallback_icon(list_t *basedirs, char *name, int *min_size, |
522 | int *max_size) { | 512 | int *max_size) { |
523 | for (int i = 0; i < basedirs->length; ++i) { | 513 | for (int i = 0; i < basedirs->length; ++i) { |
524 | char *icon = find_icon_in_dir(name, basedirs->items[i], min_size, max_size); | 514 | char *icon = find_icon_in_subdir(name, basedirs->items[i], "", ""); |
525 | if (icon) { | 515 | if (icon) { |
516 | *min_size = 1; | ||
517 | *max_size = 512; | ||
526 | return icon; | 518 | return icon; |
527 | } | 519 | } |
528 | } | 520 | } |
@@ -537,7 +529,7 @@ char *find_icon(list_t *themes, list_t *basedirs, char *name, int size, | |||
537 | icon = find_icon_with_theme(basedirs, themes, name, size, theme, | 529 | icon = find_icon_with_theme(basedirs, themes, name, size, theme, |
538 | min_size, max_size); | 530 | min_size, max_size); |
539 | } | 531 | } |
540 | if (!icon) { | 532 | if (!icon && !(theme && strcmp(theme, "Hicolor") == 0)) { |
541 | icon = find_icon_with_theme(basedirs, themes, name, size, "Hicolor", | 533 | icon = find_icon_with_theme(basedirs, themes, name, size, "Hicolor", |
542 | min_size, max_size); | 534 | min_size, max_size); |
543 | } | 535 | } |