Bug 395470 - Launching LibreOffice Calc does not replace existing icon
Summary: Launching LibreOffice Calc does not replace existing icon
Status: RESOLVED DUPLICATE of bug 396871
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.13.0
Platform: unspecified Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords: triaged
Depends on:
Blocks:
 
Reported: 2018-06-16 02:00 UTC by Chris Holland
Modified: 2018-11-08 23:31 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Holland 2018-06-16 02:00:21 UTC
I'm using KDE Neon 5.13 / Qt 5.11. I cannot recall if this affected the previous version as I didn't have it pinned then.

I noticed that switching to another virtual desktop triggered something, and caused it to replace the icon when you switched back to the original desktop.

Video: https://streamable.com/elbwe

-----
`~/.config/plasma-org.kde.plasma.desktop-appletsrc` stores:
launchers=applications:libreoffice-calc.desktop


libreoffice-calc.desktop calls `libreoffice --calc` which launches 2 processes before quitting:

/usr/lib/libreoffice/program/oosplash --calc
/usr/lib/libreoffice/program/soffice.bin --calc --splash-pipe=5

-----

Another user reported this too on reddit:
https://www.reddit.com/r/kde/comments/8rfzu0/libre_office_and_a_few_other_apps_creates_a_new/

> I'm running Manjaro (so don't know who is the culprit here), but as the title says, I have LO pinned to my Panel. So in theory, upon launching it, it should use the icon that is pinned. But it doesn't.

> As you can see from this screenshot, I have Calc pinned. But launching the app creates a new icon at the end of the panel. https://i.imgur.com/AehbWFw.jpg
Comment 1 Eike Hein 2018-06-18 10:50:10 UTC
Could you add xprop output for the Calc window that appears upon launching?
Comment 2 Eike Hein 2018-06-18 10:58:16 UTC
FWIW, I can't reproduce this with the LibreOffice version on Fedora 28. The pinned launcher is the same (applications:libeoffice-calc.desktop) and it works as expected.

I'm curious if your .desktop file contains StartupWMClass=libreoffice-calc as well, so that would be another piece of data to please supply.
Comment 3 Chris Holland 2018-06-18 23:41:38 UTC
I forgot to mention I'm using GTK LibreOffice 6.0.4.2 via the "fresh" libreoffice ppa.
LibreOffice > About > Version: https://i.imgur.com/mAx10CH.png
sudo add-apt-repository ppa:libreoffice/ppa
sudo apt install -y libreoffice libreoffice-gtk3
https://zren.github.io/kde/#libreoffice-microsoft-officeword-substitute

Just realized I have a ~/.local/share/applications/libreoffice-calc.desktop.
Both /usr/ and ~/.local/ have StartupWMClass=libreoffice-calc though.
https://i.imgur.com/GrsJBZq.png
The only difference in the two files seems to be the keys are sorted.

First I tried xprop when the Calc window had finished loading.
The only difference with the xprop output when there's a second icon and after I switched desktops to have the icon "replace" the "launcher icon" is _NET_WM_ICON_GEOMETRY which makes sense.
Screenshot of Diff: https://i.imgur.com/wWe1a5C.png
xprop Output: https://gist.github.com/Zren/8b00b9138eb374ad9005992b749a104c


Next I tried xprop when the Calc window was still loading.
I noticed the icon goes from gray => green while loading, which means it's definitely loading the generic "LibreOffice" window properties first, before loading the "Calc" icon.
xprop Output: https://gist.github.com/Zren/a79246d9f140c7679fa6e5799961ad74
Screenshot of revlevant diff: https://i.imgur.com/LydBIKN.png
Screenshot of the exact moment I ran xprop: https://i.imgur.com/wr7gcZ3.png
Video of running xprop: https://streamable.com/xzepb


Finally I tried to xprop the "splash" window.
xprop Output: https://gist.github.com/Zren/6c792b409ddb2d2283cc0e511a7a496d
Video: See the end of the previous video.


Next, I should try editing the libreoffice-calc.desktop to use "libreoffice --calc --nologo".
   --nologo            Disables the splash screen at program start.
Comment 4 Chris Holland 2018-06-18 23:49:07 UTC
I forgot to highlight that the WM_CLASS changes after loading (which you can see in the screenshot of the xprop diff).

Loading: WM_CLASS(STRING) = "soffice", "Soffice"
Ready: WM_CLASS(STRING) = "libreoffice", "libreoffice-calc"
Comment 5 Andrew Crouthamel 2018-09-28 03:24:19 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information.

For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Chris Holland 2018-10-10 13:18:43 UTC
I know this patch is related to the WM_CLASS changing:
https://phabricator.kde.org/D15410

So this might be a duplicate of Bug #396871 if that workaround fixes this issue.
https://bugs.kde.org/show_bug.cgi?id=396871

I'll need to test 5.14.0 to confirm if this bug is fixed, if so I'll close as duplicate.
Comment 7 Eike Hein 2018-10-10 14:11:48 UTC
Yeah, this is likely a duplicate.
Comment 8 Christoph Feck 2018-11-08 22:41:57 UTC
Chris, Did you have a chance yet to test?
Comment 9 Chris Holland 2018-11-08 23:31:14 UTC
Ah yes. Testing with LibreOffice 6.1.2.1 in Plasma 5.14.3, I cannot experience the bug anymore, so closing as duplicate.

For future reference, I uploaded my streamable videos to youtube since it seems the videos expired.

* https://www.youtube.com/watch?v=Akoizf5AHRQ
* https://www.youtube.com/watch?v=I7lFssa85gU

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