! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
[bug?] [unrep] icon reading-in mis-match
Status:
RESOLVED: WORKSFORME
Product:
Xfdesktop
Component:
General

Comments

Description Marek Kozłowski 2009-08-08 08:55:24 CEST
Category icons in the "main" menu (Accessories, Development, Games, Graphics, ...) depend on the same policy (the way of rendering) that application menu icons. This results in:
1. those icons can be in very different size than other "main" menu icons that looks horrible,
2. resizing those icons (see. http://forum.xfce.org/index.php?topic=4676.0) to some reasonable size results in horrible large icons in menus of ordinary applications (like: terminal etc).
Comment 1 Marek Kozłowski 2009-08-08 08:58:29 CEST
it's worth mentioning that xfce-4.6.x doesn't seem to follow GTK+ rules (parsing .gtkrc-2.0)
Comment 2 Jannis Pohlmann editbugs 2009-08-08 11:22:47 CEST
Seriously, I have no idea what you are talking about. Can you attach a screenshot or something? I suppose that icons for submenus like Accessories are loaded in exactly the same way as icons for applications. I might be wrong here, though. 

Forwarding this to Brian because libxfce4menu doesn't load the icons -- xfdesktop does.

(In reply to comment #1)
> it's worth mentioning that xfce-4.6.x doesn't seem to follow GTK+ rules
> (parsing .gtkrc-2.0)

Parsing .gtkrc-2.0 is done by GTK+ internally. Could be that Xfce overrides a few bits of it here and there but .gtkrc-2.0 is always parsed when initializing GTK+.
Comment 3 Marek Kozłowski 2009-08-08 14:44:15 CEST
(In reply to comment #2)
> Seriously, I have no idea what you are talking about. Can you attach a
> screenshot or something? I suppose that icons for submenus like Accessories are
> loaded in exactly the same way as icons for applications. I might be wrong
> here, though. 

Use for example:
   xfconf-query -c xsettings -p '/Gtk/IconSizes' -s 'gtk-menu=22,16'
You will observe, that icons for groups (Accessories, Development, Games, Graphics, ...) in the menu are of different size to other icons in the menu. Moreover -- those are of the same size as icons in menus of, for example, terminal...

Can't send a screenshot now -- I had to downgrade XFCE to 4.4.3 cause 4.6.x was unuseable (I have -6 dioptres and using "standard" icon sizes in menu is troublesome. I was unable to enlarge them properly though...) If you really can't test it (and obtain the same results) yourself -- I'll emerge (Gentoo) 4.6.x, take a screenshot and then downgrade...

> Forwarding this to Brian because libxfce4menu doesn't load the icons --
> xfdesktop does.
> 
> (In reply to comment #1)
> > it's worth mentioning that xfce-4.6.x doesn't seem to follow GTK+ rules
> > (parsing .gtkrc-2.0)
> 
> Parsing .gtkrc-2.0 is done by GTK+ internally. Could be that Xfce overrides a
> few bits of it here and there but .gtkrc-2.0 is always parsed when initializing
> GTK+.

The line:
    gtk-icon-sizes = "gtk-menu=22,16"
in .gtkrc-2.0 worked fine for XFCE 4.4.x. It doesn't in XFCE 4.6.x (see http://forum.xfce.org/index.php?topic=4676.0)
Comment 4 Marek Kozłowski 2009-08-08 15:34:25 CEST
Created attachment 2497 
XFCE 4.4.3
Comment 5 Marek Kozłowski 2009-08-08 15:35:01 CEST
Created attachment 2498 
XFCE 4.6.1
Comment 6 Marek Kozłowski 2009-08-08 15:36:47 CEST
OK, see the attachments. Mind, that if I set:
   gtk-menu=22,22
those icons get equal in size but...
...then icons in normal application menus get terribly large
Comment 7 Brian J. Tarricone (not reading bugmail) 2009-08-14 08:47:17 CEST
*** Bug 5367 has been marked as a duplicate of this bug. ***
Comment 8 Brian J. Tarricone (not reading bugmail) 2009-08-14 08:53:33 CEST
I can't really reproduce this... Neither setting gtk-icon-sizes in .gtkrc-2.0 nor the xfconf property affects menu icons sizes in any gtk application.
Comment 9 Brian J. Tarricone (not reading bugmail) 2009-08-14 09:17:45 CEST
I redid how icon sizing works so it'll always look up GTK_ICON_SIZE_MENU instead of trying to do anything custom.  Please try this version and let me know how it works:

http://mocha.xfce.org/~kelnos/testing/libxfcegui4-4.6.1git-r566ec31d.tar.bz2

Be sure to pass --prefix= to configure with the correct prefix where Xfce is installed.  You'll need to restart xfdesktop and/or the panel to make it take effect.

I still can't reproduce the problem, but I don't see how this wouldn't fix it.  It might not react to changes in gtk-icon-sizes, but it should at least be correct for the sizes set at startup.
Comment 10 Marek Kozłowski 2009-08-14 16:55:40 CEST
I've tried this with a newly created account (for elimination of trash in user settings) -- the same.

I'm a Gentoo user. I've tried both ebuilds: libxfcegui4-4.6.1 (stable) and libxfcegui4-4.6.1-r1 (unstable) -- the same

I'm not sure if I know how can I install it from the sources you linked without destruction of packages installed into my Gentoo. I'd appreciate any *overlay*, new "unofficial" ebuild, some tips for existing ebuild modification or more detailed instructions for it. Thanks in advance
Comment 11 Marek Kozłowski 2009-08-14 17:00:31 CEST
A few illustrations attached for 22,16 and 22,22 with main menu and application's menu
Comment 12 Marek Kozłowski 2009-08-14 17:01:15 CEST
Created attachment 2504 
22,16 application
Comment 13 Marek Kozłowski 2009-08-14 17:01:37 CEST
Created attachment 2505 
22,16 menu
Comment 14 Marek Kozłowski 2009-08-14 17:02:12 CEST
Created attachment 2506 
22,22 application
Comment 15 Marek Kozłowski 2009-08-14 17:02:34 CEST
Created attachment 2507 
22,22 menu
Comment 16 Brian J. Tarricone (not reading bugmail) 2009-08-14 17:07:32 CEST
Thank you, but the screenshots are not helpful.  I know what it *should* look like; I'm just unable to achieve the same on my setup.  I don't know why.

I'm not going to create ebuilds for you.  This is your bug, and you need to be a little flexible in trying to test it.  If you weren't willing to help test possible solutions, why did you bother posting a bug report at all?

If you install my package with a prefix of /usr, yes, it will overwrite your system package.  But if you keep the configured and built source directory around, you can always do "make uninstall" later, and re-emerge your system package.
Comment 17 Marek Kozłowski 2009-08-14 18:53:06 CEST
> If you install my package with a prefix of /usr, yes, it will overwrite your
> system package.  But if you keep the configured and built source directory
> around, you can always do "make uninstall" later, and re-emerge your system
> package.

OK, I've just installed by:
  # ./configure --prefix=/usr
  # make
  # make install
(the Gentoo ebuild does +/- the same)

There is *some* important difference (but it's still not OK). With this new libxfcegui4 (from http://mocha.xfce.org/~kelnos/testing/libxfcegui4-4.6.1git-r566ec31d.tar.bz2) my system behaves differently: all main menu icons as well as all application (terminal) icons are of exactly the same size -- specified by the second parameter of gtk-menu:
- gtk-menu=22,16 -- all icons in all menus are "small",
- gtk-menu-22,22 -- all icons in all menus are "large"
Comment 18 Brian J. Tarricone (not reading bugmail) 2009-08-14 22:18:14 CEST
Hmm, I'm not really sure how else to do it, then.  For the icons that just use a themed icon name (not a full path), I just do:

gtk_image_set_from_icon_name(image, icon_name, GTK_ICON_SIZE_MENU);

... and for icons that have a full path associated with them, I do:

gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
pix = gdk_pixbuf_new_from_file_at_scale(icon_name, width, height, NULL);
gtk_image_set_from_pixbuf(image, pix);

There's really nothing else I can do to make this work any differently, except for possibly using _new_from_file_at_size() to force the size to match exactly, but then you'll get weird distorted icons if the aspect ratios don't match.

Why are you varying just one number out of the two in the gtk-menu=w,h setting?  In general you'll always want square icons, so "=16,16", "=22,22", "=32,32", "=48,48", etc.  See:
http://library.gnome.org/devel/gtk/stable/GtkSettings.html#GtkSettings--gtk-icon-sizes

Actually, in that case it makes sense with the numbers you use.  22,16 gives you small icons, because they're ending up being scaled to 16x16 to keep aspect ratio.  22,22 gives you full 22x22 icons.
Comment 19 Marek Kozłowski 2009-08-15 11:26:33 CEST
(In reply to comment #18)
> Hmm, I'm not really sure how else to do it, then.  For the icons that just use
> a themed icon name (not a full path), I just do:
> 
> gtk_image_set_from_icon_name(image, icon_name, GTK_ICON_SIZE_MENU);
> 
> ... and for icons that have a full path associated with them, I do:
> 
> gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
> pix = gdk_pixbuf_new_from_file_at_scale(icon_name, width, height, NULL);
> gtk_image_set_from_pixbuf(image, pix);
> 
> There's really nothing else I can do to make this work any differently, except
> for possibly using _new_from_file_at_size() to force the size to match exactly,
> but then you'll get weird distorted icons if the aspect ratios don't match.

Why did it work for XFCE 4.4.x? Why does it work for GNOME?

> Why are you varying just one number out of the two in the gtk-menu=w,h setting?
>  In general you'll always want square icons, so "=16,16", "=22,22", "=32,32",
> "=48,48", etc.  See:
> http://library.gnome.org/devel/gtk/stable/GtkSettings.html#GtkSettings--gtk-icon-sizes
> 
> Actually, in that case it makes sense with the numbers you use.  22,16 gives
> you small icons, because they're ending up being scaled to 16x16 to keep aspect
> ratio.  22,22 gives you full 22x22 icons.

1. This setting is recommended by many sites...
2. It used to work with XFCE 4.4.x and works with GNOME
3. See https://bugs.launchpad.net/ubuntu/+source/xfce4-places-plugin/+bug/226161
4. Compare too: http://bugzilla.xfce.org/show_bug.cgi?id=4744

5. OK. I can use H==W (22x22, 16x16, ...). It's not the main problem (however it doen't work OK with "standard" -- that is not send by you -- libxfcegui4. The main problem is that enlarging icons in the main menu enlarges (to the same size) icons in menus of all applications. It's very strange and it's peculiar to XFCE 4.6.1 (no other GTK+ based Desktop does it!)
Comment 20 Marek Kozłowski 2009-08-15 11:35:57 CEST
BTW: I tried 18x18 or 20x20 sizes -- now icons vary in sizes -- some are large, some are small...
I wonder if this problem is related to SVG icons? How do you determine their size?
Comment 21 Brian J. Tarricone (not reading bugmail) 2009-08-15 16:19:50 CEST
(In reply to comment #19)

> Why did it work for XFCE 4.4.x? Why does it work for GNOME?

It didn't.  At least, not by design.  It was just luck.
 
> 1. This setting is recommended by many sites...

URLs?  These sites are wrong, then, according to the gtk documentation.  Unless I see a gtk developer agreeing with your method, the gtk docs are the authoritative source.

> 2. It used to work with XFCE 4.4.x and works with GNOME

I'm not particularly concerned with what works with gnome.

> 3. See
> https://bugs.launchpad.net/ubuntu/+source/xfce4-places-plugin/+bug/226161
> 4. Compare too: http://bugzilla.xfce.org/show_bug.cgi?id=4744

How is that authoritative?  Some random guy misinterpreting how gtk-icon-sizes works doesn't mean anything.  Read the source for how gtk interprets those numbers.  I did a couple days ago: it interprets them as width and height.

> 5. OK. I can use H==W (22x22, 16x16, ...). It's not the main problem (however
> it doen't work OK with "standard" -- that is not send by you -- libxfcegui4.

Of course not.  There's a bug in the standard libxfcegui4 that I (hopefully) fixed in the version I sent to you.  Figuring out if this is the proper fix that should go into the next version is the entire point of this exercise.

> The main problem is that enlarging icons in the main menu enlarges (to the same
> size) icons in menus of all applications. It's very strange and it's peculiar
> to XFCE 4.6.1

How is that strange at all?  gtk-icon-sizes is meant to affect all gtk-using applications.  That's the entire point of that setting being global.  If you want to be able to set a custom icon size just for the xfce menu and not for regular app menus, that would be a feature request for the xfce menu.

> (no other GTK+ based Desktop does it!)

I suspect you're mistaken.  Even if you aren't, my interest is in implementing it the same way gtk does, not in implementing some weird hack.
Comment 22 Brian J. Tarricone (not reading bugmail) 2009-08-15 16:21:55 CEST
(In reply to comment #20)
> BTW: I tried 18x18 or 20x20 sizes -- now icons vary in sizes -- some are large,
> some are small...
> I wonder if this problem is related to SVG icons? How do you determine their
> size?

That's because GtkIconTheme is annoying and doesn't rescale PNG icons if the closest match for the requested size is close, but not exact.  It will always render SVG icons to the requested size (I think; it might not do so if the requested size isn't listed in the icon theme's index.theme file).  There's nothing I can do about this.  If it bothers you, file a bug against gtk at http://bugzilla.gnome.org.
Comment 23 Brian J. Tarricone (not reading bugmail) 2009-08-17 19:44:46 CEST
Ok, I think I'm going to check in what I've got now, and we'll see how that goes.  This is at least certainly better than what's there now.  Can always reopen this bug if it turns out we need to do more.
Comment 24 Marek Kozłowski 2009-09-20 08:37:39 CEST
Why doesn't XFCE conforms to:
http://library.gnome.org/devel/gtk/2.15/GtkSettings.html#GtkSettings--gtk-icon-sizes
?
Comment 25 Marek Kozłowski 2009-09-20 09:18:25 CEST
(In reply to comment #24)
> Why doesn't XFCE conforms to:
> http://library.gnome.org/devel/gtk/2.15/GtkSettings.html#GtkSettings--gtk-icon-sizes
> ?

I mean: "the following named icon sizes: gtk-menu, gtk-button, gtk-small-toolbar, gtk-large-toolbar, gtk-dnd, gtk-dialog" in Settings Editor/xsettings/Gtk/IconSizes seem to be completely ignored :-(
Comment 26 Brian J. Tarricone (not reading bugmail) 2009-09-20 19:57:37 CEST
Huh?  Have you been paying attention to this bug at all?  I checked in fixes already.
Comment 27 Marek Kozłowski 2009-09-20 20:09:01 CEST
I only checked bugzilla activity. I'm using only ebuilds or I can build from sources if I'm sent an URL. Could you, please, direct me to the correct repository/tar.bz2 or patchset? I'm an ordinary (but keen on XFCE) user. I'm good in striking on bugs, but I'm a rather poor programmer/developer. Thanks in advance.
Comment 28 Brian J. Tarricone (not reading bugmail) 2009-09-20 20:25:52 CEST
This should work:
http://git.xfce.org/xfce/libxfcegui4/snapshot/libxfcegui4-e9aba8edc828113dfc4a4eef4cf14bc5a4932b7e.tar.bz2

You'll also need xfce4-dev-tools installed to build it.
Comment 29 Marek Kozłowski 2009-09-20 20:44:45 CEST
Sorry to bother you. Forgive me.
It's not as simple as configure/make/make install (cause there in no "configure"). I've unpacked it and...? -- I'd really appreciate a very short instruction.
Comment 30 Marek Kozłowski 2009-09-20 21:04:34 CEST
(In reply to comment #29)
> Sorry to bother you. Forgive me.
> It's not as simple as configure/make/make install (cause there in no
> "configure"). I've unpacked it and...? -- I'd really appreciate a very short
> instruction.

Sorry, obvious. Didn't notice autogen.sh :-(
Comment 31 Marek Kozłowski 2009-09-21 06:41:39 CEST
(In reply to comment #30)
> (In reply to comment #29)
> > Sorry to bother you. Forgive me.
> > It's not as simple as configure/make/make install (cause there in no
> > "configure"). I've unpacked it and...? -- I'd really appreciate a very short
> > instruction.
> 
> Sorry, obvious. Didn't notice autogen.sh :-(

OK. I have installed it:

# emerge gtk-doc
# ./autogen.sh prefix=/usr
# make
# make install

To be quite sure I have restarted not only my session by the whole system.

What should I observe? Honestly, I cannot see any difference...
Comment 32 Brian J. Tarricone (not reading bugmail) 2009-09-21 19:07:57 CEST
I don't know.  I wasn't able to see a difference, but I was never able to reproduce your original problem, either.

If any icons are displayed in different sizes now, though, there's nothing I can do about it.  It's because GtkIconTheme will return "close" icon sizes if the exact size isn't available and it "guesses" that scaling will make the icons look ugly.

Otherwise, icons from standards-compliant .desktop files that are specified just using an icon name (not a path) are handled internally by gtk, so there's nothing I can do about them.  And icons specified with a full path are always loaded by first looking up GTK_ICON_SIZE_MENU.  As far as I'm concerned, this is fixed from my perspective.  If it's still broken, it's probably something further down the stack.
Comment 33 Marek Kozłowski 2009-09-21 20:27:54 CEST
(In reply to comment #32)
> I don't know.  I wasn't able to see a difference, but I was never able to
> reproduce your original problem, either.
> 
> If any icons are displayed in different sizes now, though, there's nothing I
> can do about it.  It's because GtkIconTheme will return "close" icon sizes if
> the exact size isn't available and it "guesses" that scaling will make the
> icons look ugly.
> 
> Otherwise, icons from standards-compliant .desktop files that are specified
> just using an icon name (not a path) are handled internally by gtk, so there's
> nothing I can do about them.  And icons specified with a full path are always
> loaded by first looking up GTK_ICON_SIZE_MENU.  As far as I'm concerned, this
> is fixed from my perspective.  If it's still broken, it's probably something
> further down the stack.

Well. I've checked twice. You're right, sorry for bothering you:
1. Now all icon sizes seems to be equal. It's OK. Thanks.
2. Enlarging "gtk-menu" values enlarges icons in ordinary applications' (for example terminal) menus in GNOME 2.22/2.24/2.26 too. XFCE 4.4.x behaved differently but it seemed to be unintended.
3. Icons in GNOME main menu are handled separately -- their sizes seem to be fixed to something like 24,24.

So: please, close this bug and consider it an important feature request (any chances for 4.6.2? any chances for some simple patch?) -- I've heard lots of similar opinions. IMHO it should be quite simple:
Could main menu icon sizes be handled in some different way:
1. fixed to some larger size (24x24 let's say),
or
2. their size could be controlled by some other (settable) parameter?

16,16 is an usual and reasonable value for icons in menus of applications. Applications that are not natively GTK+-based like Firefox, OpenOffice, Acrobat etc use that size pre-set. But for the main menu this size is extremely uncomfortable.
Comment 34 Brian J. Tarricone (not reading bugmail) 2009-09-21 21:57:13 CEST
Then open a separate feature request so it can be tracked as such.
Comment 35 Nick Schermer editbugs 2010-01-20 09:19:22 CET
Code has been reverted, see bug #6166.
Comment 36 Julien [nodiscc] editbugs 2014-11-28 16:25:52 CET
The comments here are confusing. I'm not able to reproduce any of the problems mentioned. Icons are always properly displayed at the set size for me.

I suggest we close this bug, and reopen it if the problem arises again. Different icon sizes in the menu seems to be a GTK related problem.
Comment 37 Eric Koegel editbugs 2014-12-01 07:02:33 CET
Yeah, haven't heard any complaints about this. I'll mark it closed for now.

Bug #5660

Reported by:
Marek Kozłowski
Reported on: 2009-08-08
Last modified on: 2014-12-01
Duplicates (1):
  • 5367 Problem with resizing icons in menu after XFCE upgrade (4.4.3 to 4.6.1)

People

Assignee:
Brian J. Tarricone (not reading bugmail)
CC List:
3 users

Version

Attachments

XFCE 4.4.3 (87.99 KB, image/png)
2009-08-08 15:34 CEST , Marek Kozłowski
no flags
XFCE 4.6.1 (125.34 KB, image/png)
2009-08-08 15:35 CEST , Marek Kozłowski
no flags
22,16 application (68.07 KB, image/png)
2009-08-14 17:01 CEST , Marek Kozłowski
no flags
22,16 menu (106.93 KB, image/png)
2009-08-14 17:01 CEST , Marek Kozłowski
no flags
22,22 application (68.06 KB, image/png)
2009-08-14 17:02 CEST , Marek Kozłowski
no flags
22,22 menu (97.22 KB, image/png)
2009-08-14 17:02 CEST , Marek Kozłowski
no flags

Additional information