Bug 461907 - Incorrect icons for LibreOffice apps under Wayland
Summary: Incorrect icons for LibreOffice apps under Wayland
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR minor
Target Milestone: ---
Assignee: KWin default assignee
URL: https://bugs.documentfoundation.org/s...
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-16 12:42 UTC by tuefue
Modified: 2023-02-28 20:19 UTC (History)
4 users (show)

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


Attachments
Taskbar (3.14 KB, image/png)
2022-11-16 12:42 UTC, tuefue
Details
Window title (725 bytes, image/png)
2022-11-16 12:42 UTC, tuefue
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tuefue 2022-11-16 12:42:30 UTC
Created attachment 153806 [details]
Taskbar

Incorrect icons for LibreOffice apps under Wayland

SUMMARY
See attachment. Icons are correct under X11.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE Tumbleweed 
KDE Plasma Version: 5.26.3
KDE Frameworks Version: 5.99.0
Qt Version: 5.15.7
LibreOffice: 7.4.2.3
Comment 1 tuefue 2022-11-16 12:42:59 UTC
Created attachment 153807 [details]
Window title
Comment 2 Nate Graham 2022-11-16 18:18:16 UTC
Pretty sure this is a bug in LibreOffice where it inappropriately changes its window properties after launch, but kwin_wayland can probably support it like kwin_x11 does.
Comment 3 Gauthier 2023-02-28 14:26:49 UTC
(In reply to Nate Graham from comment #2)
> Pretty sure this is a bug in LibreOffice where it inappropriately changes
> its window properties after launch, but kwin_wayland can probably support it
> like kwin_x11 does.

Hi Nate, actually this likely related to a bug in QT not in LO (or at least something QT does not yet support for wayland). See (https://bugs.documentfoundation.org/show_bug.cgi?id=125934)  and (https://bugreports.qt.io/browse/QTBUG-77182).

I was going to open a new issue with the text below to ask for an enhancement cause a hack has been found but I'm putting it on here and feel free to move it to a new one if you prefer.

There is QT bug (https://bugreports.qt.io/browse/QTBUG-77182) opened in 2019 but yet unsolved which prevents to select the correct icon when using LibreOffice under wayland (and which therefore makes it quite annoying to manage several open documents). The issue was also there for GTK but has been fixed. 

This is well document in the LO bug report (https://bugs.documentfoundation.org/show_bug.cgi?id=125934) and there is nothing to be done on there side, it has to be fixed in QT. 

However someone found a hack to get the correct behaviour in Plasma using kwin window rules (https://bugs.documentfoundation.org/show_bug.cgi?id=125934#c15). I have tried it and it works great! This greatly improve the experience of using LO in Plasma wayland and so it'd seems worth implementing by default either at the Plasma level (if possible) or distro specific level.

I reckon this is also what was hit the bug 443334 but it seems worth opening a new issue regarding implementing this hack as the bug was original opened in relation to flatpack app
Comment 4 Gauthier 2023-02-28 14:48:42 UTC
Just a quick precision: for the hack to work it has to be done this way:

Open say LibreOffice Calc, right click on title bar > More Actions and then go to:
Configure Special Application Settings (and not Window Settings as described in the LO bug report)
Then Add Property... > Window Title > there select Substring Match and leave only LibreOffice Calc
Then  Add Property...> Desktop file name > there select Force and enter libreoffice-calc

Et voila :) Thank you Almighty Kwin :))))
Comment 5 Nate Graham 2023-02-28 18:28:24 UTC
Why does LO have to change its icon in the first place though? Most apps don't need to do this. So fixing the Qt bug in question is certainly one option, but is there a reason why LO can't change its own code to stop changing its window icon? That would let it not encounter the Qt bug in the first place, no?
Comment 6 Gauthier 2023-02-28 18:52:24 UTC
What do you need by change it's icons? Libre office has several components which share the same base and so while different LO apps (writer, calc, etc) can be launch independently and have different icons, on launch it still calls the overarching LO program and then branch into the separate applications and under Wayland Qt does not have an easy way to identify though separate windows. So I agree it is certainly l the case that LO could change something in there code to change how they call their apps on launch but this behaviour has been their for ages and was working fine in X11, and they've been a patch in gtk for it to work on Wayland...so it seems more sensible for it to be patch in Qt, especially as I doubt LO is the only app doing it that way. But to be honest you probably know much better than me, I'm only sharing the knowledge I have on this topic.

I know it feels ugly and really not the right way of doing things, but what do you think about implementing a hack for it behaves well in plasma?
Comment 7 Gauthier 2023-02-28 20:19:53 UTC
Same message as above but with more correct English grammar...sorry it's late in my time zone and my brain can't process a foreign language.

What do you mean by change its icons? LibreOffice has several components which share the same base and so while different LO apps (writer, calc, etc) can be launched independently and have different icons, when you actually start any of them it calls the overarching LO program and then branch into the separate applications. Under Wayland and Qt only the overarching LO program is detected and so it displays the standard LO icon (the black one) and currently there is no easy way to identify the separate apps. So I agree it is certainly the case that LO could change something in their code to change how they call their apps on launch but this behaviour has been there for ages and was working fine in X11, and there've been a patch in gtk for it to work on Wayland...so it seems more sensible for it to be patch in Qt, especially as I doubt LO is the only app doing it that way. But to be honest you probably know much better than me, I'm only sharing the knowledge I have on this topic.

I know it feels ugly and really not the right way of doing things, but what do you think about implementing a hack for it behaves well in plasma?