GNOME Bugzilla – Bug 335582
Show Desktop Button Icon gets scaled
Last modified: 2006-08-08 18:12:23 UTC
The icon in the show desktop button is getting scaled. This makes the icon blurry and not look as nice as it could. The attached patch fixes this issue.
Created attachment 61797 [details] [review] Patch to fix scaling of show desktop icon This patch increases the default allotment for the button border, so that a better icon size gets selected, and we avoid scaling.
To be honest, I don't see much of a difference here (except that we're getting a smaller icon on a 24px panel) :-) With what size and icon theme are you testing?
I'm testing on a 24px panel with the GNOME and Tango themes, and the icon is blurry, meaning that it's getting scaled.
So, can we commit this?
Please bear with me: I'm trying to understand... I have a 24px panel. This means the applet requests an icon of 24-4 = 20px. There are a 16px and a 24px icon. Isn't the issue here that GTK+ returns the 24px one?
Not exactly. If it returned the 16px one, for 20px, and it got scaled up, it would look much worse. The real problem is that scaling is occuring regardless of whether or not the icon theme says the icons are Fixed, I guess. However, there are so many places in the code path where this could be happening, that it's hard to determine where exactly it is happening, in a lot of situations. And, it's basically impossible to guarantee that all possible applications that use the icon theme, will never scale the icons, as anyone could get the icon at native size, and then just use the scaling methods to scale it, outside the icon theme implementation. I think if we set the border to 2 or 0, we'll end up with the problem being that the icon gets clipped again. Unfortunately, for a panel that is less than 24px tall, this means that the icon still gets scaled, with this patch.
But your patch means that it will only work for panels with a size that is "size of an icon" + 8. Eg, it won't work for 48px panels. Or 26px. Or...
Working for the majority of cases (24px, the default size), is better than working for oddly sized cases, I think. The fact that the icon is inside of a GtkButton makes this rather problematic. Perhaps the show desktop button needs to be changed to match the behavior of Log Out, Lock Screen, etc... which look like launchers, and we could just drop the specialized icon code for it, and take advantage of the launcher widget icon stuff, which handles the panel sizes better.
Vincent? Poke? So, can we get this patch in?
I fixed this the correct way. 2006-08-08 Vincent Untz <vuntz@gnome.org> * showdesktop.c: (applet_size_allocated): renamed to button_size_allocated() (update_icon): take into account the focus width and focus pad and thickness of the button to calculate the icon size also, force the icon size to be 16, 22 or 32 if it's < 22, < 32 and < 48 (show_desktop_applet_fill): connect to the size_allocate signal of the button, and not of the applet Fix bug #335582