From 94be8fa628e3407c44e47cfa018023e4eb3dc9a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberts=20Muktup=C4=81vels?= Date: Tue, 22 Mar 2022 20:32:43 +0200 Subject: icon-cache: reset origin if property change invalidates icon Client theoretically can unset / remove icon. We need to reset origin to make sure we try to load icon from other sources. Test application that can be used to set/unset icons: https://gitlab.gnome.org/GNOME/libwnck/-/merge_requests/42 --- src/core/iconcache.c | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/src/core/iconcache.c b/src/core/iconcache.c index d4c2f0fd..4dec0049 100644 --- a/src/core/iconcache.c +++ b/src/core/iconcache.c @@ -458,17 +458,6 @@ meta_icon_cache_free (MetaIconCache *icon_cache) icon_cache->origin = USING_NO_ICON; } -void -meta_icon_cache_property_changed (MetaIconCache *icon_cache, - MetaDisplay *display, - Atom atom) -{ - if (atom == display->atom__NET_WM_ICON) - icon_cache->net_wm_icon_dirty = TRUE; - else if (atom == XA_WM_HINTS) - icon_cache->wm_hints_dirty = TRUE; -} - static gboolean meta_icon_cache_get_icon_invalidated (MetaIconCache *icon_cache) { @@ -486,6 +475,22 @@ meta_icon_cache_get_icon_invalidated (MetaIconCache *icon_cache) return FALSE; } +void +meta_icon_cache_property_changed (MetaIconCache *icon_cache, + MetaDisplay *display, + Atom atom) +{ + if (atom == display->atom__NET_WM_ICON) + icon_cache->net_wm_icon_dirty = TRUE; + else if (atom == XA_WM_HINTS) + icon_cache->wm_hints_dirty = TRUE; + + if (!meta_icon_cache_get_icon_invalidated (icon_cache)) + return; + + icon_cache->origin = USING_NO_ICON; +} + static GdkPixbuf* scaled_from_pixdata (guchar *pixdata, int w, -- cgit v1.2.1