[gtk/wip/fanc999/gtk-3-24-meson-msvc: 66/297] statusicon: Create pixbuf at correct size



commit 0363be77239c532cde2b05356f11f83667dc80f6
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Wed Dec 12 19:55:20 2018 +0200

    statusicon: Create pixbuf at correct size
    
    Surface returned from gtk_icon_helper_load_surface can be smaller
    then requested pixel size. This happens when icon is embedded in
    panel that has bigger size then loaded pixbuf.

 gtk/deprecated/gtkstatusicon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gtk/deprecated/gtkstatusicon.c b/gtk/deprecated/gtkstatusicon.c
index 28535df491..b67f74791a 100644
--- a/gtk/deprecated/gtkstatusicon.c
+++ b/gtk/deprecated/gtkstatusicon.c
@@ -1420,7 +1420,9 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
   surface = gtk_icon_helper_load_surface (icon_helper, 1);
   if (surface)
     {
-      pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, round_size, round_size);
+      pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0,
+                                            cairo_image_surface_get_width (surface),
+                                            cairo_image_surface_get_height (surface));
       cairo_surface_destroy (surface);
     }
   else


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]