Applications icons in taskbar fix.
authorAnton Lobashev <soulthreads@users.sourceforge.net>
Mon, 28 Feb 2011 22:00:00 +0000 (00:00 +0200)
committerAndriy Grytsenko <andrej@rep.kiev.ua>
Sat, 15 Nov 2014 16:52:28 +0000 (18:52 +0200)
plugins/launchtaskbar.c

index 0cdc549..f1cd5a8 100644 (file)
@@ -2225,7 +2225,15 @@ static GdkPixbuf * get_wm_icon(Window task_win, guint required_width, guint requ
         return NULL;
     else
     {
-        GdkPixbuf * ret = gdk_pixbuf_scale_simple(pixmap, required_width, required_height, GDK_INTERP_TILES);
+        gulong w = gdk_pixbuf_get_width (pixmap);
+       gulong h = gdk_pixbuf_get_height (pixmap);
+       if ((w > required_width) || (h > required_height))
+       {
+           w = required_width;
+           h = required_height;
+       }
+
+        GdkPixbuf * ret = gdk_pixbuf_scale_simple(pixmap, w, h, GDK_INTERP_TILES);
         g_object_unref(pixmap);
         *current_source = possible_source;
         return ret;