[libwnck/wip/muktupavels/icons: 14/16] window: load icons only in getters
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/icons: 14/16] window: load icons only in getters
- Date: Mon, 14 Mar 2022 18:09:03 +0000 (UTC)
commit f7a750db2e791380ce71acd822c7abc78ad97145
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Mar 14 19:49:40 2022 +0200
window: load icons only in getters
libwnck users might not use icons at all or might use only normal
or mini icon. Redo code to get icons only when getters are used.
libwnck/window.c | 32 --------------------------------
1 file changed, 32 deletions(-)
---
diff --git a/libwnck/window.c b/libwnck/window.c
index 8acae684..a92b1000 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -2105,36 +2105,10 @@ wnck_window_transient_is_most_recently_activated (WnckWindow *window)
return FALSE;
}
-static void
-get_icons (WnckWindow *window)
-{
- GdkPixbuf *icon;
- GdkPixbuf *mini_icon;
-
- icon = NULL;
- mini_icon = NULL;
-
- _wnck_read_icons (window->priv->icon_cache, &icon, &mini_icon);
-
- g_assert ((icon && mini_icon) || !(icon || mini_icon));
-
- g_clear_object (&icon);
- g_clear_object (&mini_icon);
-}
-
-static void
-_wnck_window_load_icons (WnckWindow *window)
-{
- g_return_if_fail (WNCK_IS_WINDOW (window));
-
- get_icons (window);
-}
-
void
_wnck_window_invalidate_icons (WnckWindow *self)
{
_wnck_icon_cache_invalidate (self->priv->icon_cache);
- _wnck_window_load_icons (self);
}
/**
@@ -2154,8 +2128,6 @@ wnck_window_get_icon (WnckWindow *window)
{
g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL);
- _wnck_window_load_icons (window);
-
return _wnck_icon_cache_get_icon (window->priv->icon_cache);
}
@@ -2176,8 +2148,6 @@ wnck_window_get_mini_icon (WnckWindow *window)
{
g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL);
- _wnck_window_load_icons (window);
-
return _wnck_icon_cache_get_mini_icon (window->priv->icon_cache);
}
@@ -3284,8 +3254,6 @@ force_update_now (WnckWindow *window)
update_frame_extents (window); /* emits signals */
update_role (window); /* emits signals */
- get_icons (window);
-
new_state = COMPRESS_STATE (window);
if (old_state != new_state)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]