diff options
author | Victor Kareh <[email protected]> | 2018-05-01 00:24:38 -0400 |
---|---|---|
committer | raveit65 <[email protected]> | 2018-05-12 21:15:34 +0200 |
commit | 10b2021f0a98f1575400aac2beffd8e3c47ecdd5 (patch) | |
tree | d625ff63f823fcb481f47fc7f11b502f4418ac2f /mate-panel/xstuff.c | |
parent | f775e8987f8279ea2fb259126e61d0b26cf78817 (diff) | |
download | mate-panel-10b2021f0a98f1575400aac2beffd8e3c47ecdd5.tar.bz2 mate-panel-10b2021f0a98f1575400aac2beffd8e3c47ecdd5.tar.xz |
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
Diffstat (limited to 'mate-panel/xstuff.c')
-rw-r--r-- | mate-panel/xstuff.c | 17 |
1 files changed, 11 insertions, 6 deletions
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)); |