[libwnck/wip/muktupavels/icons: 7/16] window: remove icons from private struct
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/icons: 7/16] window: remove icons from private struct
- Date: Mon, 14 Mar 2022 18:09:03 +0000 (UTC)
commit 29238949ebe30aafc2acdcf05a9711c20117dd54
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Mar 14 14:56:05 2022 +0200
window: remove icons from private struct
We can return icons from icon cache.
libwnck/window.c | 32 ++++++--------------------------
1 file changed, 6 insertions(+), 26 deletions(-)
---
diff --git a/libwnck/window.c b/libwnck/window.c
index 1222e865..b2cd2a74 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -87,9 +87,6 @@ struct _WnckWindowPrivate
WnckWindowType wintype;
- GdkPixbuf *icon;
- GdkPixbuf *mini_icon;
-
WnckIconCache *icon_cache;
WnckWindowActions actions;
@@ -410,14 +407,6 @@ wnck_window_finalize (GObject *object)
g_free (window->priv->session_id_utf8);
window->priv->session_id_utf8 = NULL;
- if (window->priv->icon)
- g_object_unref (G_OBJECT (window->priv->icon));
- window->priv->icon = NULL;
-
- if (window->priv->mini_icon)
- g_object_unref (G_OBJECT (window->priv->mini_icon));
- window->priv->mini_icon = NULL;
-
g_clear_pointer (&window->priv->icon_cache, _wnck_icon_cache_free);
g_free (window->priv->startup_id);
@@ -2116,21 +2105,12 @@ get_icons (WnckWindow *window)
mini_icon = NULL;
if (_wnck_read_icons (window->priv->icon_cache, &icon, &mini_icon))
- {
- window->priv->need_emit_icon_changed = TRUE;
-
- if (window->priv->icon)
- g_object_unref (G_OBJECT (window->priv->icon));
+ window->priv->need_emit_icon_changed = TRUE;
- if (window->priv->mini_icon)
- g_object_unref (G_OBJECT (window->priv->mini_icon));
-
- window->priv->icon = icon;
- window->priv->mini_icon = mini_icon;
- }
+ g_assert ((icon && mini_icon) || !(icon || mini_icon));
- g_assert ((window->priv->icon && window->priv->mini_icon) ||
- !(window->priv->icon || window->priv->mini_icon));
+ g_clear_object (&icon);
+ g_clear_object (&mini_icon);
}
static void
@@ -2171,7 +2151,7 @@ wnck_window_get_icon (WnckWindow *window)
_wnck_window_load_icons (window);
- return window->priv->icon;
+ return _wnck_icon_cache_get_icon (window->priv->icon_cache);
}
/**
@@ -2193,7 +2173,7 @@ wnck_window_get_mini_icon (WnckWindow *window)
_wnck_window_load_icons (window);
- return window->priv->mini_icon;
+ return _wnck_icon_cache_get_mini_icon (window->priv->icon_cache);
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]