From 10b2021f0a98f1575400aac2beffd8e3c47ecdd5 Mon Sep 17 00:00:00 2001 From: Victor Kareh Date: Tue, 1 May 2018 00:24:38 -0400 Subject: Convert launcher icons to cairo surfaces This improves support for HiDPI by loading properly scaled surfaces for launcher and drawer icons. It also Fixes the Show Desktop wncklet to show a surface icon. Other wncklets have their icons determined by libwnck, so they remain as pixbufs. Fixes mate-desktop/mate-desktop#314 --- mate-panel/xstuff.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'mate-panel/xstuff.c') diff --git a/mate-panel/xstuff.c b/mate-panel/xstuff.c index 7db48acf..21d58825 100644 --- a/mate-panel/xstuff.c +++ b/mate-panel/xstuff.c @@ -328,7 +328,7 @@ draw_zoom_animation (GdkScreen *gscreen, void xstuff_zoom_animate (GtkWidget *widget, - GdkPixbuf *pixbuf, + cairo_surface_t *surface, PanelOrientation orientation, GdkRectangle *opt_rect) { @@ -353,12 +353,17 @@ xstuff_zoom_animate (GtkWidget *widget, gscreen = gtk_widget_get_screen (widget); - if (gdk_screen_is_composited (gscreen) && pixbuf) + if (gdk_screen_is_composited (gscreen) && surface) { + GdkPixbuf *pixbuf = gdk_pixbuf_get_from_surface (surface, + 0, 0, + cairo_image_surface_get_width (surface), + cairo_image_surface_get_height (surface)); draw_zoom_animation_composited (gscreen, - rect.x, rect.y, - rect.width, rect.height, - pixbuf, orientation); - else { + rect.x, rect.y, + rect.width, rect.height, + pixbuf, orientation); + g_object_unref (pixbuf); + } else { display = gdk_screen_get_display (gscreen); monitor = gdk_display_get_monitor_at_window (display, gtk_widget_get_window (widget)); -- cgit v1.2.1