diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-03-22 20:32:43 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-03-22 20:32:43 +0200 |
commit | 94be8fa628e3407c44e47cfa018023e4eb3dc9a1 (patch) | |
tree | edd5300c9cb11bee780e937f7a8caacf9cec9568 /src/core/iconcache.c | |
parent | 4ea95a3b1cc3fbbecffa08c6026945abb9d9fe7d (diff) | |
download | metacity-94be8fa628e3407c44e47cfa018023e4eb3dc9a1.tar.gz |
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
Diffstat (limited to 'src/core/iconcache.c')
-rw-r--r-- | src/core/iconcache.c | 27 |
1 files 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, |