Bug 425403 - Standalone KCMs launched via shortcut on desktop have Wayland generic icon in window decoration and task switcher
Summary: Standalone KCMs launched via shortcut on desktop have Wayland generic icon in...
Status: RESOLVED FIXED
Alias: None
Product: kde-cli-tools
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Neon Linux
: LO minor
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
: 437513 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-08-15 21:13 UTC by Patrick Silva
Modified: 2022-01-14 10:39 UTC (History)
4 users (show)

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


Attachments
screenshot (654.22 KB, image/png)
2020-08-15 21:13 UTC, Patrick Silva
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrick Silva 2020-08-15 21:13:52 UTC
Created attachment 130900 [details]
screenshot

STEPS TO REPRODUCE
1. open your apps laucnher and search for some KCM, let's say Global Theme
2. right-click on "global theme" search result and choose "Add to desktop"
3. launch Global Theme kcm via its icon created on desktop

OBSERVED RESULT
As we can see in the attached screenshot, the window decoration of the launched KCM has Wayland generic icon. Task switcher (alt+tab) shows the same icon.

EXPECTED RESULT
Window decoration and task switcher should show the same icon
observed in the task manager.

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.19.80
KDE Frameworks Version: 5.74.0
Qt Version: 5.14.2
Comment 1 Nate Graham 2020-10-12 23:06:59 UTC
Can confirm, but lowering priority now that most KCMs open in System Settings.
Comment 2 Patrick Silva 2021-01-24 16:08:36 UTC
Currently this issue affects KCMs not present in System Settings, like Plasma Renderer
and Trash.

Operating System: Arch Linux
KDE Plasma Version: 5.20.90
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Comment 3 Nicolas Fella 2021-05-22 20:41:39 UTC
*** Bug 437513 has been marked as a duplicate of this bug. ***
Comment 4 Nicolas Fella 2021-05-22 20:56:14 UTC
kcmshell tries to set an icon, but that only works on X11, not Wayland.

It boils down to 
    QDialog d;
    d.setWindowIcon(QIcon::fromTheme("cuttlefish"));
    d.show();

not working on Wayland
Comment 5 Aleix Pol 2021-08-31 00:59:10 UTC
Just don't use kcmshell5.

From Plasma 5.23 there's plasma-open-settings which will launch system settings (or plasma-settings if that's what you have) that works better on many levels.

This issue isn't realistically fixable on Wayland.
Comment 6 Nate Graham 2021-08-31 14:56:08 UTC
It's not realistic to make QDialog::setWindowIcon() work on Wayland?
Comment 7 Aleix Pol 2021-08-31 16:59:40 UTC
Well, the short answer (besides "no") is "it's not fixable under xdg-shell", as what we use to display the icon is the desktop file.

Well we could make it show a random icon, surely not the kcm's.
Comment 8 Nate Graham 2021-09-02 15:24:07 UTC
I believe you, but it kind of boggles my mind that such a thing is unfixable by design. It would seem to point to a faulty design somewhere...
Comment 9 Aleix Pol 2021-09-02 16:07:33 UTC
we could have kcms install themselves as applications, then kwin would find it I guess?

The way KWin figures out the icon is by getting a desktop file (e.g. "firefox.desktop") then looking it up and using the Icon field within.

We'd need to specify the desktop file for the KCM I guess and make sure it's in a place that KWin can find it.
Comment 10 Nate Graham 2021-09-02 21:52:15 UTC
Don't KCMs already have .desktop files?
Comment 11 Nicolas Fella 2021-09-02 21:54:12 UTC
Those are not installed into /usr/share/applications though
Comment 12 Nate Graham 2021-09-02 21:55:58 UTC
Is there a good reason not to? I guess if we did that they would show up in Kickoff etc, so maybe that's the reason. Is there a "hidden" flag or something we could set to make that not happen, yet still let them be seen by KWin?
Comment 13 Aleix Pol 2021-09-02 22:09:09 UTC
Feels like a big detour. As a general rule, kcms are opened with system settings and we don't have a problem with that.

In fact, why is this not a problem for systemsettings? Would showing the systemsettings icons here solve the problem?
Comment 14 Nate Graham 2021-09-02 23:14:25 UTC
Yeah that would probably be fine. KCMs opened in KCMshell are rare now anyway. Hence the "LO minor" importance level, I guess. :)
Comment 15 Aleix Pol 2021-09-03 15:51:39 UTC
Turns out I was quite wrong in my assessment.

On the bright side, it's fixed with the following MR.
Comment 16 Bug Janitor Service 2021-09-03 15:52:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1370
Comment 17 Aleix Pol 2021-09-06 11:49:08 UTC
Git commit 73279acc63f72d36b8040e614fa489b7dcbfe127 by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 06/09/2021 at 11:48.
Pushed by apol into branch 'master'.

Fix absolute desktop file names

Qt understands that the spec wants the id without .desktop postfix and
chops it, so we need to add it back if we want to infer the desktop
file.
https://code.qt.io/cgit/qt/qtwayland.git/tree/src/client/qwaylandwindow.cpp?h=5.15#n161

M  +7    -2    src/abstract_client.cpp

https://invent.kde.org/plasma/kwin/commit/73279acc63f72d36b8040e614fa489b7dcbfe127
Comment 18 Patrick Silva 2021-10-02 11:53:11 UTC
Can reproduce again on neon unstable.

Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.23.80
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 19 Patrick Silva 2022-01-14 10:39:48 UTC
Cannot reproduce on Arch (Plasma 5.24 beta) and neon unstable.