Fix icons

Since commit ea94f7f7e6, the code has a preferred icon size and it tries to
find the closest matching icon. However, the default size of 0 and thus this
never returned any icon at all (no icon matches better than an icon of size
0x0).

Fix this by saying "every icon is better than no icon at all".

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2015-12-23 14:19:18 +01:00
parent daff5cd58b
commit b2be471faf
1 changed files with 1 additions and 1 deletions

2
ewmh.c
View File

@ -694,7 +694,7 @@ ewmh_window_icon_from_reply(xcb_get_property_reply_t *r, uint32_t preferred_size
bool better_because_bigger = found_icon_too_small && size > found_size;
bool better_because_smaller = found_icon_too_large &&
size >= preferred_size && size < found_size;
if (!icon_empty && (better_because_bigger || better_because_smaller))
if (!icon_empty && (better_because_bigger || better_because_smaller || found_size == 0))
{
found_data = data;
found_size = size;