Skip to content

Commit e748e91

Browse files
xdavidwuvilhalmer
authored andcommitted
resolve_icon: also try second level relative dir name for icon size and scale
1 parent 762d6f7 commit e748e91

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

icon.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,16 @@ static char *resolve_icon(struct mako_notification *notif) {
113113
errno = 0;
114114
int32_t icon_size = strtol(relative_path, NULL, 10);
115115
if (errno || icon_size == 0) {
116-
continue;
116+
// Try second level subdirectory if failed.
117+
errno = 0;
118+
while (relative_path[0] != '/') {
119+
++relative_path;
120+
}
121+
++relative_path;
122+
icon_size = strtol(relative_path, NULL, 10);
123+
if (errno || icon_size == 0) {
124+
continue;
125+
}
117126
}
118127

119128
int32_t icon_scale = 1;

0 commit comments

Comments
 (0)