Bug 429596 - Launcher runner prefers .desktop file with Exec= line in it over one which lacks it, which causes KCMs to be opened in KCMShell instead of System Settings under certain circumstances
Summary: Launcher runner prefers .desktop file with Exec= line in it over one which la...
Status: RESOLVED FIXED
Alias: None
Product: krunner
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR minor
Target Milestone: ---
Assignee: Alexander Lohnau
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2020-11-24 16:10 UTC by Nate Graham
Modified: 2022-09-08 04:54 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2020-11-24 16:10:01 UTC
This just started happening recently after working for a while.

Not sure what to bisect.
Comment 1 Alexander Lohnau 2020-11-25 18:15:30 UTC
Have you tried running `kbuildsycoca5` and then restarting KRunner.

Might be an issue inside of KServive which has been fixed.
Comment 2 Nate Graham 2020-11-25 18:27:22 UTC
Yeah, that doesn't fix it. :(
Comment 3 Alexander Lohnau 2020-12-09 20:18:27 UTC
The only way this can happen is that you have old .desktop files lying around. In the new versions the Exec line was completely removed and is internally in KService generated. But the old files still have the Exec line, consequently KService does not override that value.

Can you please say which KCMs specifically and check that they are up-to-date with master?
Comment 4 Nate Graham 2020-12-10 04:03:56 UTC
All of them. Every single one. :)

The problem isn't not stale files because I just cleared out my entire built-from-source installation and rebuilt everything from scratch today. KCMs opened from Kickoff etc and KRunner are still opening in KCMShell rather than System Settings.
Comment 5 Harald Sitter 2020-12-15 10:29:37 UTC
I can't reproduce this on neon unstable FWIW
Comment 6 Alexander Lohnau 2020-12-15 10:43:14 UTC
@Nate can you please check that the KCM desktop files from your built-from-source stuff are the ones that are being launched? Just try a notify command in the Exec=

And next please do the same with one of the files in /usr.
Comment 7 Nate Graham 2020-12-15 21:48:21 UTC
Yes, if I add "Exec=notify-send foo bar" to /home/nate/kde/usr/share/kservices5/kcm_workspace.desktop and then open the workspace KCM from KRunner or Kickoff, I see a notification rather than the KCM opening.
Comment 8 Nate Graham 2020-12-15 21:52:30 UTC
Ah I think I see the problem. My distro-provided desktop files have "Exec=kcmshell5 [whatever]" in them. My built-from-source ones do not. The KRunner runner that finds KCMs appears to prefer the distro's .desktop files because they have an Exec= line in them. If I remove the Exec= line from the distro-provided desktop files, or add "Exec=systemsettings5 kcm_workspace" to my built-from source desktop files, everything works.

So the bug is that a desktop file with Exec= in it is preferred over one which does not. Thankfully users shouldn't hit this, but it's still annoying for devs. :)
Comment 9 Nate Graham 2022-09-08 04:54:39 UTC
Resolved recently.