summaryrefslogtreecommitdiff
path: root/src/core/window.c
diff options
context:
space:
mode:
authorVictor Kareh <[email protected]>2021-06-23 07:24:20 -0400
committerVictor Kareh <[email protected]>2023-03-07 14:24:09 -0500
commitc99c8523877fd72cf53035d63c5fe0f75be7657c (patch)
tree0cd268860765e13e837765048e2c0e145b0ec965 /src/core/window.c
parent32f1967142a078ecdb4222c05d62c75710fb74fa (diff)
downloadmarco-c99c8523877fd72cf53035d63c5fe0f75be7657c.tar.bz2
marco-c99c8523877fd72cf53035d63c5fe0f75be7657c.tar.xz
window: Convert all icons to cairo surfacesalt-tab-icons-hidpi
Diffstat (limited to 'src/core/window.c')
-rw-r--r--src/core/window.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/src/core/window.c b/src/core/window.c
index 08cd99c7..7a1ddb3b 100644
--- a/src/core/window.c
+++ b/src/core/window.c
@@ -6126,24 +6126,14 @@ meta_window_update_icon_now (MetaWindow *window)
&icon,
icon_size,
&mini_icon,
- META_MINI_ICON_SIZE,
+ META_MINI_ICON_SIZE * scale,
scale))
{
- if (window->icon)
- g_object_unref (G_OBJECT (window->icon));
+ g_clear_pointer (&window->icon, cairo_surface_destroy);
+ g_clear_pointer (&window->mini_icon, cairo_surface_destroy);
- if (window->mini_icon)
- g_object_unref (G_OBJECT (window->mini_icon));
-
- window->icon = gdk_pixbuf_get_from_surface (icon,
- 0, 0,
- icon_size, icon_size);
- cairo_surface_destroy (icon);
-
- window->mini_icon = gdk_pixbuf_get_from_surface (mini_icon,
- 0, 0,
- META_MINI_ICON_SIZE, META_MINI_ICON_SIZE);
- cairo_surface_destroy (mini_icon);
+ window->icon = icon;
+ window->mini_icon = mini_icon;
redraw_icon (window);
}
@@ -9003,8 +8993,8 @@ meta_window_finalize (GObject *object)
window = META_WINDOW (object);
- g_clear_object (&window->icon);
- g_clear_object (&window->mini_icon);
+ g_clear_pointer (&window->icon, cairo_surface_destroy);
+ g_clear_pointer (&window->mini_icon, cairo_surface_destroy);
g_clear_pointer (&window->frame_bounds, cairo_region_destroy);