Bug 1234776

Summary: gnome shell shows "Emacs Client" instead of "Emacs"
Product: [Fedora] Fedora Reporter: Jan Synacek <jsynacek>
Component: gnome-shellAssignee: Owen Taylor <otaylor>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: unspecified    
Version: 22CC: fmuellner, h1k6zn2m, otaylor
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1332670 (view as bug list) Environment:
Last Closed: 2015-06-26 12:50:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jan Synacek 2015-06-23 08:40:29 UTC
Description of problem:
See Steps to Reproduce and Actual results.


Version-Release number of selected component (if applicable):
gnome-shell-3.16.2-1.fc22.x86_64
emacs-24.5-2.fc22.x86_64


Steps to Reproduce:
1. Install Fedora 22 Workstation and emacs
2. Start emacs (either from Activities or even command line)
3. Go to Activities and observe
   - or -
   Press Alt-tab and observe

Actual results:
In both cases, the icon caption says "Emacs Client" when in fact I'm running just emacs.


Expected results:
Icon is correctly captioned as "Emacs".


Additional info:
It seems like gnome-shell is confused about the fact that there are both emacs.desktop and emacsclient.desktop present in /usr/share/applications/, and they both have Icon=emacs.

Comment 1 Florian Müllner 2015-06-25 11:35:50 UTC
(In reply to Jan Synacek from comment #0)
> Additional info:
> It seems like gnome-shell is confused about the fact that there are both
> emacs.desktop and emacsclient.desktop present in /usr/share/applications/,
> and they both have Icon=emacs.

No, we don't look at the icon to figure out the corresponding application. The most important bit is the WM_CLASS set on the window, what does running "xprop | grep WM_CLASS" in a terminal print out?

Comment 2 Jan Synacek 2015-06-26 10:10:35 UTC
$ xprop | grep WM_CLASS
WM_CLASS(STRING) = "emacs", "Emacs"

$ xprop | grep Emacs
WM_CLASS(STRING) = "emacs", "Emacs"

No sign of "Emacs Client" here.

Comment 3 Florian Müllner 2015-06-26 12:50:59 UTC
OK, so I figured out the culprit: One of the first steps we do when trying to match a window to an application is to look for a .desktop file that contains a StartupWMClass that matches the window's WM_CLASS. In this case, this is true for both emacs.desktop and emacsclient.desktop and we end up picking a "random" one. I've filed an upstream bug with a patch, let's track the issue there.
If you want to apply a workaround until the issue is properly fixed, you can copy emacsclient.desktop into $HOME/.local/share/applications and change the StartupWMClass key to something else (for instance 'EmacsClient').

Comment 4 Jan Synacek 2015-06-29 06:50:37 UTC
That was quick, thank you!

Comment 5 Jan Synacek 2015-12-15 12:03:11 UTC
*** Bug 1246806 has been marked as a duplicate of this bug. ***