After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 92346 - Window icons don't respect icon theme
Window icons don't respect icon theme
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
2.0.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
Metacity maintainers list
AP3
: 98489 114887 120266 120487 121761 122280 128059 (view as bug list)
Depends on:
Blocks: 116896
 
 
Reported: 2002-09-02 17:26 UTC by Calum Benson
Modified: 2011-02-04 16:17 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch (7.36 KB, patch)
2003-11-29 00:25 UTC, Matthias Clasen
needs-work Details | Review
a new patch (13.53 KB, patch)
2004-06-25 18:50 UTC, Matthias Clasen
none Details | Review

Description Calum Benson 2002-09-02 17:26:51 UTC
The icons in the window list, the workspace switcher and in the popup
window that appears when you cycle between windows, desktops or panels do
not respect the current icon theme (as being drafted on freedesktop.org). 
Thus in a high or low contrast theme, you still get the default coloured
icons showing up in those places.
Comment 1 Havoc Pennington 2002-09-02 23:07:49 UTC
Fun for the whole family - fixing this means adding support for it to
the platform, then changing all the apps. Can't be done on the
metacity level.
Comment 2 Owen Taylor 2003-07-02 22:50:37 UTC
Icon theme support is now in GTK+, so it's just a matter 
of adding 

 gtk_window_set_icon_name()
 gtk_window_set_default_icon_name()

(There may be some issues in the icon theme handling code
if we want to set the correct icon list and provide the
icon at all sizes at which it exists in the icon theme...
it's not clear what size we would look it up at with the
current icon theme API)
Comment 3 Calum Benson 2003-08-07 16:18:55 UTC
Apologies for spam... marking as GNOMEVER2.3 so it appears on the official GNOME
bug list :)
Comment 4 Owen Taylor 2003-08-25 14:32:14 UTC
*** Bug 120487 has been marked as a duplicate of this bug. ***
Comment 5 Vincent Untz 2003-09-22 16:07:23 UTC
*** Bug 122280 has been marked as a duplicate of this bug. ***
Comment 6 Vincent Untz 2003-09-22 16:07:34 UTC
*** Bug 121761 has been marked as a duplicate of this bug. ***
Comment 7 Vincent Untz 2003-09-22 16:07:43 UTC
*** Bug 120266 has been marked as a duplicate of this bug. ***
Comment 8 Vincent Untz 2003-09-22 16:09:14 UTC
*** Bug 114887 has been marked as a duplicate of this bug. ***
Comment 9 Calum Benson 2003-10-17 15:35:32 UTC
*** Bug 98489 has been marked as a duplicate of this bug. ***
Comment 10 bill.haneman 2003-11-28 15:39:31 UTC
Can we get clarification on where the fix for this needs to be, and
whether we need new API or not?  Thanks - if we need API changes, time
is very tight indeed.
Comment 11 Matthias Clasen 2003-11-28 20:21:10 UTC
I think Owen already clarified the necessary API additions here:

gtk_window_set_icon_name()
gtk_window_set_default_icon_name()

Then you have to go around and change all uses of set_icon() and
set_default_icon() by the _name() variants.
Comment 12 Matthias Clasen 2003-11-29 00:24:29 UTC
Here is a preliminary patch, not tested beyond compilation. 
Things which are still missing are:

- test it
- handle screen changes
- when default icon name is set, must connect to changed signal
  for icon theme on all screens
- icon sizes should probably be handled more intelligently
Comment 13 Matthias Clasen 2003-11-29 00:25:08 UTC
Created attachment 21914 [details] [review]
patch
Comment 14 Calum Benson 2003-12-03 12:54:17 UTC
*** Bug 128059 has been marked as a duplicate of this bug. ***
Comment 15 bill.haneman 2003-12-05 12:16:23 UTC
marking 'normal' instead of 'enhancement' - since theme-compliance
isn't considered a 'new feature', it's expected of icons in GNOME
nowadays (I hope!).  

Note that there are 7 (!) duplicates of this bug... can we get the
patch reviewed for 2.4, _please_ ?  thanks.  It would substantially
enhance GNOME 2.6's theme compliance if we could get this in.
Comment 16 Matthias Clasen 2004-02-11 13:33:50 UTC
Bill, have you tested the patch ? That and working on the known 
deficiencies is the most effective way to get this closer to GNOME 2.6 




I'll ask owen whether he sees issues beyond the ones listed above...
Comment 17 Owen Taylor 2004-02-26 19:41:02 UTC
Although this would be really nice to have, I don't think we
are close enough on this to do it for GNOME-2.4.

Issues with the patch:

* I'm really not happy with the approach of loading the
  icon at a bunch of "random" sizes and setting them in
  the list. Putting a scaled icon into the icon list
  is very likely to result in the final icon being displayed
  to the user being double scaled, and hence extremely
  fuzzy.

  The set of icons set as the list should be all or a
  subset of the sizes that the icon is actually available at.
  This may require GtkIconTheme API enhancements.

* The general approach here doesn't work right for things like
  RSVG icons, or when we need an icon at anything other than
  one of the specificied sizes. I'd like to see a WM spec
  enhancement so that GTK+ could advertise the icon name
  as well, so that if the window manager / icon list, whatever
  understood it, it could go directly from that.

* The way I'd do the notification for screen changes is to
  hook up to GtkIconTheme::changed in realize_icon, this
  gives you notification on all relevant screens and largely
  covers over the per-window / default differences.

(Adding this wouldn't do us much good for GNOME-2.6 considering
how close we to code freeze for GNOME...)
Comment 18 Matthias Clasen 2004-06-25 18:50:06 UTC
Created attachment 29009 [details] [review]
a new patch

Here is the patch again, I've added api to obtain the list of available icon
sizes from the theme. This doesn't handle scalable icons at all yet. But it
seems to work nicely in my quick tests.
Comment 19 Owen Taylor 2004-07-16 21:53:06 UTC
In gtk_window_set_icon_name(), etc, when calling update_themed_icon()
I'd probably just pass in NULL for icon_theme ... I don't see a point
in getting the theme and then not using it.

I think by policy we do do the work so that

 gtk_window_set_icon_name (window, gtk_window_get_icon_name (window))

works - i.e., add a if (name == info->icon_name) return;

Would be nice to expand the docs for gtk_window_set_icon_name() a 
bit.

Maybe

 Sets the icon for the window from a named themed icon. See
 the docs for #GtkIconTheme for more details.

And then ref set_icon_name() in get_icon_name(). The current
docs are especially bad because "icon name" means something else
in the ICCCM. (A short name for a window to display in the  icon)

gtk_window_set_default_icon_name() is missing docs.

For icons with only a scalable image, it would probably be best to set 
them at at least a fixed size (say 48) rather than not set them at all.

Other than those, the patch looks good to me.

Comment 20 Matthias Clasen 2004-07-17 03:55:37 UTC
Committed, with fixes for the mentioned issues