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 646689 - Wrong icon shown in app menu
Wrong icon shown in app menu
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 647167 651074 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2011-04-04 09:02 UTC by Stef Walter
Modified: 2013-08-15 01:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screenshot which demonstrates the problem. (24.63 KB, image/png)
2011-04-04 09:02 UTC, Stef Walter
  Details
ShellWindowTracker: Ensure WM_CLASS remains canonical if it matches (1.44 KB, patch)
2011-04-05 16:50 UTC, Colin Walters
committed Details | Review

Description Stef Walter 2011-04-04 09:02:10 UTC
The app menu (i think it's called that, it's near the top of the screen with current app name and faded icon) has the wrong icon when I:

 1. Click on accessibility menu (right hand side of top panel).
 2. Choose "Universal Access Settings"
 3. Click on "All Settings"
 4. Go to any other control panel.

In addition with any other control panel open, if I repeat steps above, the 'Universal Access Settings' does not appear.
Comment 1 Stef Walter 2011-04-04 09:02:55 UTC
Created attachment 185092 [details]
Screenshot which demonstrates the problem.
Comment 2 Hans de Goede 2011-04-05 16:23:08 UTC
Also see:
https://bugzilla.redhat.com/show_bug.cgi?id=690852

For a more detailed description as well as some possibly related side effects wrt launching capplets from the user / accessibility panek menus.
Comment 3 Colin Walters 2011-04-05 16:50:35 UTC
Created attachment 185219 [details] [review]
ShellWindowTracker: Ensure WM_CLASS remains canonical if it matches

I unintentionally made .desktop->pid association "win" over
WM_CLASS.  Fixing this makes the case of ancillary .desktop file
entry points (e.g. gnome-control-center's various shortcut .desktop
files) correctly show System Settings, and not whatever the shortcut
is.

In the future I'd like to have a way to say "this .desktop file
is a shortcut, ignore me" or something.
Comment 4 Colin Walters 2011-04-05 16:51:00 UTC
This turned out to be a trivial fix.
Comment 5 Colin Walters 2011-04-05 16:55:01 UTC
(In reply to comment #3)
>
> In the future I'd like to have a way to say "this .desktop file
> is a shortcut, ignore me" or something.

This would allow us to e.g. show the correct name during startup-notification.  Basically:

X-GNOME-Shortcut-For: gnome-control-center.desktop
Exec=gnome-control-center

(that'd be it, no need for translations since we don't show them, etc.)
Comment 6 Dan Winship 2011-04-06 15:40:17 UTC
Comment on attachment 185219 [details] [review]
ShellWindowTracker: Ensure WM_CLASS remains canonical if it matches

this looks right, as far as it goes, but the icon is still wrong(?) while the control center is starting up. (It shows the a11y icon until the window is mapped, at which point it switches to the control center icon.)

> In the future I'd like to have a way to say "this .desktop file
> is a shortcut, ignore me" or something.

gnome-universal-access-panel.desktop:
    Exec=gnome-control-center universal-access

gnome-control-center.desktop:
    Exec=gnome-control-center

They have the same argv[0], so the one with the argc>1 Exec key must be a specialized form of the one with the argc==1 exec key.
Comment 7 Colin Walters 2011-04-07 13:50:14 UTC
(In reply to comment #6)
> (From update of attachment 185219 [details] [review])
> this looks right, as far as it goes, but the icon is still wrong(?) while the
> control center is starting up. (It shows the a11y icon until the window is
> mapped, at which point it switches to the control center icon.)

That's expected, and what I was explaining here:

> > In the future I'd like to have a way to say "this .desktop file
> > is a shortcut, ignore me" or something.
> 
> gnome-universal-access-panel.desktop:
>     Exec=gnome-control-center universal-access
> 
> gnome-control-center.desktop:
>     Exec=gnome-control-center
> 
> They have the same argv[0], so the one with the argc>1 Exec key must be a
> specialized form of the one with the argc==1 exec key.

Hmmm...I'm wary of trying to unify on argv[0].  For one thing, consider interpreters like /bin/sh.
Comment 8 Dan Winship 2011-04-07 14:06:51 UTC
but you'd never have a .desktop file with *just* Exec=/bin/sh. So you wouldn't be able to unify "Exec=/bin/sh foo" with "Exec=/bin/sh bar", etc.

(I guess I wasn't totally explicit on that before; it's not just that one .desktop file's Exec key is a prefix of the other's, it's that the shorter one takes no arguments, and the longer one launches the same program with arguments.)

...except that that wouldn't actually work, because gnome-control-center.desktop runs "gnome-control-center --overview". Hm.

Also, we'd have to allow %f/%F/%u/%U in the "no arguments" one, or else it wouldn't work anywhere. With that exception though, it would match brasero-nautilus ("nautilus --no-default-window --no-desktop burn:///") to nautilus ("nautilus %U") and vinagre ("vinagre %U") to vinagre-file ("vinagre -F %U"). It would not know what to do with shotwell ("shotwell %U") vs shotwell-viewer ("shotwell %f") though.

(And those 4 are the only duplicate argv[0]s in my current F15 install.)
Comment 9 Dan Winship 2011-04-07 14:08:57 UTC
Comment on attachment 185219 [details] [review]
ShellWindowTracker: Ensure WM_CLASS remains canonical if it matches

at any rate, the state with the patch is certainly better than the state without the patch, and it looks like there may not be an easy better fix for now
Comment 10 Florian Müllner 2011-04-08 14:19:14 UTC
*** Bug 647167 has been marked as a duplicate of this bug. ***
Comment 11 Owen Taylor 2011-04-21 19:29:56 UTC
Comment on attachment 185219 [details] [review]
ShellWindowTracker: Ensure WM_CLASS remains canonical if it matches

Was pushed
Comment 12 Owen Taylor 2011-04-21 19:43:24 UTC
Removing from the GnomeShell301 tracker, though possibly this should be closed if "In the future I'd like to have a way to say "this .desktop file is a shortcut, ignore me" or something." is just a vague wish list that we don't have concrete plans to fixed.
Comment 13 Florian Müllner 2011-05-25 16:16:45 UTC
*** Bug 651074 has been marked as a duplicate of this bug. ***
Comment 14 Jasper St. Pierre (not reading bugmail) 2013-08-15 01:51:11 UTC
This has been fixed at some point.