Launchpad has imported 10 comments from the remote bug at
https://bugzilla.xfce.org/show_bug.cgi?id=13785.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://help.launchpad.net/InterBugTracking.

------------------------------------------------------------------------
On 2017-08-15T20:50:13+00:00 Stefanberzl wrote:

Created attachment 7268
A screenshot of the issue

Some packages only provide icons in sizes much bigger than the standard
GTK menu size of 16px.

The clipboard manager qlipper for example provides the following icon:
/usr/share/icons/hicolor/128x128/apps/qlipper.png

In GTK 3.22.18 the function gtk_image_new_from_icon_name when given
GTK_ICON_SIZE_MENU as second argument still returns an image with 128x128.

The patch I have supplied uses existing code to scale such an image.

diff --git a/garcon-gtk/garcon-gtk-menu.c b/garcon-gtk/garcon-gtk-menu.c
index 41990f2..f31a1ed 100644
--- a/garcon-gtk/garcon-gtk-menu.c
+++ b/garcon-gtk/garcon-gtk-menu.c
@@ -650,7 +650,11 @@ garcon_gtk_menu_load_icon (const gchar *icon_name)
   gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
   size = MIN (w, h);
 
-  if (! gtk_icon_theme_has_icon (icon_theme, icon_name))
+  if (gtk_icon_theme_has_icon (icon_theme, icon_name))
+    {
+         pixbuf = gtk_icon_theme_load_icon (icon_theme, icon_name, size, 0, 
NULL);;
+    }
+  else
     {
       if (g_path_is_absolute (icon_name))
         {
@@ -684,22 +688,23 @@ garcon_gtk_menu_load_icon (const gchar *icon_name)
               g_free (name);
             }
         }
+    }
 
-      /* Turn the pixbuf into a gtk_image */
-      if (G_LIKELY (pixbuf))
-        {
-          /* scale the pixbuf down if it needs it */
-          GdkPixbuf *tmp = gdk_pixbuf_scale_simple (pixbuf, w, h, 
GDK_INTERP_BILINEAR);
-          g_object_unref (pixbuf);
-          pixbuf = tmp;
+  /* Turn the pixbuf into a gtk_image */
+  if (G_LIKELY (pixbuf))
+    {
+      /* scale the pixbuf down if it needs it */
+      GdkPixbuf *pixbuf_scaled = gdk_pixbuf_scale_simple (pixbuf, w, h, 
GDK_INTERP_BILINEAR);
+      g_object_unref (G_OBJECT (pixbuf));
 
-          image = gtk_image_new_from_pixbuf (pixbuf);
-          g_object_unref (G_OBJECT (pixbuf));
-        }
+      image = gtk_image_new_from_pixbuf (pixbuf_scaled);
+      g_object_unref (G_OBJECT (pixbuf_scaled));
+    }
+  else
+    {
+         /* display the placeholder at least */
+         image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
     }
-
-  if (image == NULL)
-    image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
 
   return image;
 }

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/0

------------------------------------------------------------------------
On 2017-08-15T21:01:45+00:00 Stefanberzl wrote:

Created attachment 7269
The patch for scaling the icons

It's probably better here than in the comments.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/1

------------------------------------------------------------------------
On 2017-08-21T15:40:11+00:00 Gitbot wrote:

Stefan Berzl referenced this bugreport in commit
4387496fe332a50945e7db76bc2196b419656fe3

fix: some menu icons are too big (Bug #13785)

https://git.xfce.org/xfce/garcon/commit?id=4387496fe332a50945e7db76bc2196b419656fe3

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/2

------------------------------------------------------------------------
On 2017-08-21T15:41:14+00:00 Eric Koegel wrote:

Pushed your patch, thanks!

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/3

------------------------------------------------------------------------
On 2017-08-24T17:01:07+00:00 Olivier Duchateau wrote:

(In reply to Eric Koegel from comment #3)
> Pushed your patch, thanks!

This patch breaks quicklaunch default applications icons (buttons have
disappeared).

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/4

------------------------------------------------------------------------
On 2017-08-25T16:59:28+00:00 Olivier Duchateau wrote:

(In reply to Olivier Duchateau from comment #4)
> (In reply to Eric Koegel from comment #3)
> > Pushed your patch, thanks!
> 
> This patch breaks quicklaunch default applications icons (buttons have
> disappeared).

I find workaround for Xfdashboard (where quicklaunch buttons have
disappeared) and now everything works fine!

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/5

------------------------------------------------------------------------
On 2017-08-25T21:12:10+00:00 Stefanberzl wrote:

How do you suppose the scalling of the images has anything to do with the new 
return type
from libxfconf? The change in still hasn't permeated into every part of the 
software.
The settings-editor for example can't display arrays because it also assumes 
the old type.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/6

------------------------------------------------------------------------
On 2018-10-19T20:09:57+00:00 Manuel Grießmayr wrote:

I upgraded my system from Xubuntu 18.04 64 bit x86 to version 18.10.
Since version 18.10 I have this issue :(

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/7

------------------------------------------------------------------------
On 2018-10-19T20:29:55+00:00 Manuel Grießmayr wrote:

On the same system I also have this issue:
https://bugzilla.xfce.org/show_bug.cgi?id=14774.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/8

------------------------------------------------------------------------
On 2018-11-07T18:07:08+00:00 Manuel Grießmayr wrote:

Here is some information which may help to reproduce my problem. I have
not installed Firefox via Synaptic but instead downloaded it via the
mozilla page. I only had to extract the compressed file and then launch
the executable. So my Firefox is installed under /home/myname/bin
/firefox-release/. Then I created a .desktop file under
/home/myname/.local/share/applications/ and set the icon name to
"firefox quantum". This icon can be found under
/home/myname/.local/share/icons/hicolor/128x128/apps/ and has a width
and height of 128 pixels.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/garcon/+bug/1806256/comments/9


** Changed in: garcon
       Status: Unknown => Fix Released

** Changed in: garcon
   Importance: Unknown => Medium

** Bug watch added: Xfce Bugzilla #14774
   https://bugzilla.xfce.org/show_bug.cgi?id=14774

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1806256

Title:
  Menu icons don't all have the same size

To manage notifications about this bug go to:
https://bugs.launchpad.net/garcon/+bug/1806256/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to