Bug 453776

Summary: [Wayland] Launch feedback creates two entries in the task manager when I open certain flatpaks from flathub or when I open apps via shortcuts created with kmenuedit
Product: [Plasma] plasmashell Reporter: Patrick Silva <bugseforuns>
Component: Task Manager and Icons-Only Task Manager widgetsAssignee: Plasma Bugs List <plasma-bugs-null>
Status: CONFIRMED ---    
Severity: normal CC: nate, nicolas.fella, qydwhotmail
Priority: NOR Keywords: wayland-only
Version First Reported In: 6.3.3   
Target Milestone: 1.0   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: screen recording
.desktop file of Firefox

Description Patrick Silva 2022-05-14 12:26:27 UTC
Created attachment 148825 [details]
screen recording

SUMMARY
I have shortcuts to run Firefox and Opera natively on Wayland, both were created with kmenuedit.
Every time I open Firefox or Opera via these shortcuts, I see two entries in the task manager during launch feedback - please watch the attached screen recording. This bug does not occur when I open the browsers via their default shortcuts.
I'm also attaching the .desktop file of Firefox.

EXPECTED RESULT
only one entry in the task manager during launch feedback

SOFTWARE/OS VERSIONS
Operating System: KDE neon Unstable Edition
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.3
Graphics Platform: Wayland
Comment 1 Patrick Silva 2022-05-14 12:27:15 UTC
Created attachment 148826 [details]
.desktop file of Firefox
Comment 2 Patrick Silva 2022-05-15 12:10:18 UTC
I can also reproduce with certain faltpaks installed from flathub:
VLC player
Deluge torrent client
Transmission torrent client
Peazip
Swell Foop game
Comment 3 Nate Graham 2022-05-16 16:35:55 UTC
Can reproduce.
Comment 4 Patrick Silva 2022-05-28 12:29:11 UTC
Can also reproduce on neon unstable with these steps:

1. search for Touchpad or Mouse KCMs with kickoff
2. right-click on the KCM you searched for and choose 'Add to desktop'
3. open the KCM via icon created on desktop
Comment 5 Bug Janitor Service 2022-09-17 14:45:47 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kconfig/-/merge_requests/141
Comment 6 Bug Janitor Service 2022-09-17 16:08:43 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/2136
Comment 7 Fushan Wen 2022-09-17 17:04:19 UTC
You need to add `X-KDE-AliasFor=systemsettings` to the KCM desktop file.
Comment 8 Patrick Silva 2022-09-17 18:13:46 UTC
(In reply to Fushan Wen from comment #7)
> You need to add `X-KDE-AliasFor=systemsettings` to the KCM desktop file.

This would fix KCMs, right? What about the flatpaks and apps whose shortcuts were created with kmenuedit?
Comment 9 Fushan Wen 2022-09-18 00:18:58 UTC
(In reply to Patrick Silva from comment #8)
> (In reply to Fushan Wen from comment #7)
> > You need to add `X-KDE-AliasFor=systemsettings` to the KCM desktop file.
> 
> This would fix KCMs, right? What about the flatpaks and apps whose shortcuts
> were created with kmenuedit?

Something like X-KDE-AliasFor=org.kde.krita.desktop will help. Replace systemsettings with corresponding appid instead
Comment 10 Bug Janitor Service 2022-09-18 08:30:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kcmutils/-/merge_requests/105
Comment 11 Nicolas Fella 2022-09-18 18:44:39 UTC
For the Flatpak case the problem is probably that sometimes the Flatpak version and non-Flatpak version have different desktop file names.

In that case the Flatpak version has a X-Flatpak-RenamedFrom key in the desktop file pointing to the original name, so we should be able to use that for matching
Comment 12 Nicolas Fella 2022-09-18 18:53:22 UTC
The issue can also be seen with Okular:

- Have Okular pinned to the task manager
- Click on a PDF file
-> The startup task is appearing in addition to the launcher entry.

This is because Okular has separate desktop files for each filetype. The problem does not appear when launching Okular from kickoff (i.e. without any file)
Comment 13 Nicolas Fella 2023-01-03 02:46:39 UTC
https://invent.kde.org/plasma/kwin/-/merge_requests/3386 or https://invent.kde.org/frameworks/kio/-/merge_requests/1100 fixes the issue for KCMs and Okular.

I can't reproduce the Opera issue with Opera using XWayland, but there the startup feeedback doesn't terminate properly, which is a somewhat related issue