diff options
author | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-03-15 16:17:09 +0200 |
---|---|---|
committer | Alberts Muktupāvels <alberts.muktupavels@gmail.com> | 2022-08-15 09:57:26 +0000 |
commit | 72fee2a5c40cb7ef320a409d54d2dff6e5fe8321 (patch) | |
tree | dbb993a5a2ba219b0f4684108d179b9b45ee1756 /libwnck/wnck-handle.c | |
parent | 9affe86870bdef2a4e7b07e31b6aac70ae53ddf0 (diff) | |
download | libwnck-72fee2a5c40cb7ef320a409d54d2dff6e5fe8321.tar.gz |
util: move icon reloading to WnckHandle
Missing part from 8260794f4d73219d026c53b6d57244ddf52d34a6.
Diffstat (limited to 'libwnck/wnck-handle.c')
-rw-r--r-- | libwnck/wnck-handle.c | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/libwnck/wnck-handle.c b/libwnck/wnck-handle.c index 6f8579f..4bfa5c1 100644 --- a/libwnck/wnck-handle.c +++ b/libwnck/wnck-handle.c @@ -64,6 +64,43 @@ static GParamSpec *handle_properties[LAST_PROP] = { NULL }; G_DEFINE_TYPE (WnckHandle, wnck_handle, G_TYPE_OBJECT) +static void +invalidate_icons (WnckHandle *self) +{ + Display *xdisplay; + int i; + + xdisplay = _wnck_get_default_display (); + + for (i = 0; i < ScreenCount (xdisplay); ++i) + { + WnckScreen *screen; + GList *windows; + GList *l; + + screen = self->screens[i]; + + if (screen == NULL) + continue; + + windows = wnck_screen_get_windows (screen); + + for (l = windows; l != NULL; l = l->next) + { + WnckWindow *window; + WnckApplication *application; + + window = WNCK_WINDOW (l->data); + application = wnck_window_get_application (window); + + _wnck_window_load_icons (window); + + if (application != NULL) + _wnck_application_load_icons (application); + } + } +} + static GdkFilterReturn filter_func (GdkXEvent *gdkxevent, GdkEvent *event, @@ -471,7 +508,12 @@ wnck_handle_set_default_icon_size (WnckHandle *self, { g_return_if_fail (WNCK_IS_HANDLE (self)); + if (self->default_icon_size == icon_size) + return; + self->default_icon_size = icon_size; + + invalidate_icons (self); } gsize @@ -496,7 +538,12 @@ wnck_handle_set_default_mini_icon_size (WnckHandle *self, { g_return_if_fail (WNCK_IS_HANDLE (self)); + if (self->default_mini_icon_size == icon_size) + return; + self->default_mini_icon_size = icon_size; + + invalidate_icons (self); } gsize |