Bug 382142

Summary: Panel icon wrong: Does not match window icon
Product: plasmashell Reporter: Ralf Jung <post>
Component: Task Manager and Icons-Only Task ManagerAssignee: Eike Hein <hein>
Status: RESOLVED DUPLICATE    
Severity: normal CC: kde, plasma-bugs
Priority: NOR    
Version: 5.8.7   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Screenshot demonstrating the issue. Notice how the icon in the window does not match the icon in the panel.
xprop of Firefox Nightly
xprop of Firefox Stable

Description Ralf Jung 2017-07-09 05:03:17 UTC
Created attachment 106513 [details]
Screenshot demonstrating the issue. Notice how the icon in the window does not match the icon in the panel.

Plasma sometimes displays the wrong panel icon for Firefox Nightly.  The icon shown in the top-left corner of the window is correct, so I assume that the application is properly setting its window properties -- but Plasma, for some reason, decides to use the "normal" Firefox icon rather than the Firefox Nightly icon for these windows.

I've already seen this happen some days ago, but then it was fixed by restarting Firefox Nightly.  Now the bug has come back, and this time, restarts do not help.

Unfortunately, I have no idea how Plasma picks the icon, so I don't know where to start debugging.

This is with Debian testing amd64.
Comment 1 Kai Uwe Broulik 2017-07-10 12:16:04 UTC
Can you please provide the xprop output of the Nightly window (run xprop and then click the Firefox window) and also the .desktop file of it in /usr/share/applications and best also provide the one from vanilla Firefox so we can find something that lets us tell the difference.

The icon in the window is provided by the application as a pixmap whereas task manager uses the icon name from the application. Mapping windows to application is quite hard and sometimes fails as shown here.
Comment 2 Kai Uwe Broulik 2017-07-10 12:16:27 UTC
(Please set status back to Unconfirmed when you provided the information)
Comment 3 Ralf Jung 2017-07-10 17:25:17 UTC
There is no icon for this in /usr/share/applications; I installed Nightly by downloading the tarball and extracting it somewhere.  Sure icons should work for all applications, not just those installed by root?  Same for Firefox, is is also just installed in $HOME.

I will attach xprop output for nightly and stable.
Comment 4 Ralf Jung 2017-07-10 17:25:53 UTC
Created attachment 106539 [details]
xprop of Firefox Nightly
Comment 5 Ralf Jung 2017-07-10 17:26:10 UTC
Created attachment 106540 [details]
xprop of Firefox Stable
Comment 6 Eike Hein 2017-07-11 05:49:00 UTC
If you install an application in your $HOME you're responsible for putting a .desktop file specifying the icon in $HOME/.local/share/applications and also deploying the icon.
Comment 7 Ralf Jung 2017-07-11 06:04:56 UTC
> If you install an application in your $HOME you're responsible for putting a .desktop file specifying the icon in $HOME/.local/share/applications and also deploying the icon.

Are you serious?  Most of the time, I don't even bother to create a menu entry for an application.  The Alt+F2 menu works just fine for applications symlinked from ~/bin.  KWin demonstrates that showing the icon for such applications is perfectly possible.  So, to be frank, I think it is quite ridiculous to not support this. It is quite surprising as well.  People observing this behavior will see a bug in KDE, there is no way to *know* that .desktop files are suddenly considered mandatory by some software.

But, okay, in the interest of making progress let me play my your rules -- it's your software after all.  I added a menu entry for nightly using KMenuEditor.  This is what the .desktop file looks like:

$ cat ~/.local/share/applications/firefox-2.desktop 
[Desktop Entry]
Comment=Browse the World Wide Web
Encoding=UTF-8
Exec=/home/r/bin/firefox-nightly
GenericName=Web Browser
Icon=/home/r/bin/firefox.nightly.d/browser/icons/mozicon128.png
MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;
Name=Firefox Nightly
NoDisplay=false
Path[$e]=
StartupNotify=true
StartupWMClass=Firefox
Terminal=0
TerminalOptions=
Type=Application
X-GNOME-FullName=Firefox Web Browser
X-KDE-SubstituteUID=false
X-KDE-Username=
X-MultipleArgs=false

The issue remains the same:  I started Firefox Nightly from the KDE menu, and still, the taskbar panel shows the wrong icon.  Reopening because the reason given dos not apply any more.
Comment 8 Eike Hein 2017-07-11 07:05:09 UTC
You can read more about the situation here: https://bugs.kde.org/show_bug.cgi?id=369658#c4

Unfortunately on 5.8.x you're going to have to rename the .desktop file to Firefox.desktop for things to work. In later releases, the matching would also work via the revamped StartupWMClass handling.
Comment 9 Ralf Jung 2017-08-28 15:33:25 UTC
Thanks for that, this is interesting information.  I guess I should try to somehow create a service file for both versions of Firefox, and see if that helps.

Also, my version of KDE is so outdated at this point that I can perfectly understand that you don't want to support it any more.
Comment 10 Christoph Feck 2017-09-20 00:26:39 UTC
Is this ticket is a duplicate of bug 369658, or should we keep it open?
Comment 11 Eike Hein 2017-09-20 09:02:15 UTC

*** This bug has been marked as a duplicate of bug 369658 ***