[libwnck/wip/muktupavels/icons: 8/21] icon-cache: store also WnckScreen in struct
- From: Alberts Muktupāvels <muktupavels src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libwnck/wip/muktupavels/icons: 8/21] icon-cache: store also WnckScreen in struct
- Date: Fri, 16 Sep 2022 12:25:54 +0000 (UTC)
commit 5b0424ef9bba934d9eb9af16be8c5cf32194885c
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date: Mon Mar 14 14:28:18 2022 +0200
icon-cache: store also WnckScreen in struct
libwnck/application.c | 5 ++---
libwnck/window.c | 5 ++---
libwnck/wnck-icon-cache-private.h | 6 +++---
libwnck/wnck-icon-cache.c | 10 ++++++----
4 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/libwnck/application.c b/libwnck/application.c
index 472145c8..2988600f 100644
--- a/libwnck/application.c
+++ b/libwnck/application.c
@@ -322,8 +322,7 @@ get_icons (WnckApplication *app)
normal_size = _wnck_handle_get_default_icon_size (handle);
mini_size = _wnck_handle_get_default_mini_icon_size (handle);
- if (_wnck_read_icons (app->priv->screen,
- app->priv->icon_cache,
+ if (_wnck_read_icons (app->priv->icon_cache,
&icon,
normal_size,
&mini_icon,
@@ -518,7 +517,7 @@ _wnck_application_create (Window xwindow,
application->priv->xwindow = xwindow;
application->priv->screen = screen;
- application->priv->icon_cache = _wnck_icon_cache_new (xwindow);
+ application->priv->icon_cache = _wnck_icon_cache_new (xwindow, screen);
_wnck_icon_cache_set_want_fallback (application->priv->icon_cache, FALSE);
application->priv->name = _wnck_get_name (xscreen, xwindow);
diff --git a/libwnck/window.c b/libwnck/window.c
index ce755c82..566d93e6 100644
--- a/libwnck/window.c
+++ b/libwnck/window.c
@@ -486,7 +486,7 @@ _wnck_window_create (Window xwindow,
window->priv->xwindow = xwindow;
window->priv->screen = screen;
- window->priv->icon_cache = _wnck_icon_cache_new (xwindow);
+ window->priv->icon_cache = _wnck_icon_cache_new (xwindow, screen);
_wnck_handle_insert_window (handle, &window->priv->xwindow, window);
@@ -2122,8 +2122,7 @@ get_icons (WnckWindow *window)
normal_size = _wnck_handle_get_default_icon_size (handle);
mini_size = _wnck_handle_get_default_mini_icon_size (handle);
- if (_wnck_read_icons (window->priv->screen,
- window->priv->icon_cache,
+ if (_wnck_read_icons (window->priv->icon_cache,
&icon,
normal_size,
&mini_icon,
diff --git a/libwnck/wnck-icon-cache-private.h b/libwnck/wnck-icon-cache-private.h
index 67eeab8f..f40c0b78 100644
--- a/libwnck/wnck-icon-cache-private.h
+++ b/libwnck/wnck-icon-cache-private.h
@@ -29,7 +29,8 @@ G_BEGIN_DECLS
typedef struct _WnckIconCache WnckIconCache;
-WnckIconCache *_wnck_icon_cache_new (Window xwindow);
+WnckIconCache *_wnck_icon_cache_new (Window xwindow,
+ WnckScreen *screen);
void _wnck_icon_cache_free (WnckIconCache *icon_cache);
void _wnck_icon_cache_property_changed (WnckIconCache *icon_cache,
Atom atom);
@@ -38,8 +39,7 @@ void _wnck_icon_cache_set_want_fallback (WnckIconCache *icon_cache
gboolean setting);
gboolean _wnck_icon_cache_get_is_fallback (WnckIconCache *icon_cache);
-gboolean _wnck_read_icons (WnckScreen *screen,
- WnckIconCache *icon_cache,
+gboolean _wnck_read_icons (WnckIconCache *icon_cache,
GdkPixbuf **iconp,
int ideal_size,
GdkPixbuf **mini_iconp,
diff --git a/libwnck/wnck-icon-cache.c b/libwnck/wnck-icon-cache.c
index 627223e9..5338a8f9 100644
--- a/libwnck/wnck-icon-cache.c
+++ b/libwnck/wnck-icon-cache.c
@@ -42,6 +42,7 @@ typedef enum
struct _WnckIconCache
{
Window xwindow;
+ WnckScreen *screen;
IconOrigin origin;
Pixmap prev_pixmap;
@@ -456,13 +457,15 @@ scaled_from_pixdata (guchar *pixdata,
}
WnckIconCache*
-_wnck_icon_cache_new (Window xwindow)
+_wnck_icon_cache_new (Window xwindow,
+ WnckScreen *screen)
{
WnckIconCache *icon_cache;
icon_cache = g_slice_new0 (WnckIconCache);
icon_cache->xwindow = xwindow;
+ icon_cache->screen = screen;
icon_cache->origin = USING_NO_ICON;
icon_cache->prev_pixmap = None;
@@ -528,8 +531,7 @@ _wnck_icon_cache_get_is_fallback (WnckIconCache *icon_cache)
}
gboolean
-_wnck_read_icons (WnckScreen *screen,
- WnckIconCache *icon_cache,
+_wnck_read_icons (WnckIconCache *icon_cache,
GdkPixbuf **iconp,
int ideal_size,
GdkPixbuf **mini_iconp,
@@ -549,7 +551,7 @@ _wnck_read_icons (WnckScreen *screen,
g_return_val_if_fail (icon_cache != NULL, FALSE);
- xscreen = _wnck_screen_get_xscreen (screen);
+ xscreen = _wnck_screen_get_xscreen (icon_cache->screen);
display = DisplayOfScreen (xscreen);
*iconp = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]