Set the correct desktop file name when in a KDE session.

Authored by hein on Mar 10 2017, 4:39 PM.



System Settings installs two .desktop files:

  • kdesystemsettings.desktop setting NotShowIn=KDE, for non-KDE desktops
  • systemsettings.desktop, the one we use in Plasma

As of 39e13de3468a, it sets "kdesystemsettings" as its desktop file
name using KAboutData. As this is not the one we show in our menus,
it's not the one used as applicationId for the KStartupInfo provided
to the Task Manager after starting System Settings. With the eventual
window telling the Task Manager to use a different .desktop file, the
Task Manager can no longer match up the startup notification and the
window, causing them to co-exist instead of replace each other.

Telling the environment you're running in to look at a .desktop file
you've also told it to ignore is wrong app behavior, and this should
not be worked around in the Task Manager (especially as it would
cause I/O in a hotpath, requiring it to open and parse the .desktop
file to realize it's crummy and ignore it, falling back from the
window hint to a slow heuristic).

This patch instead makes it use the correct desktop file name when
KDE_FULL_SESSION is set. This completes the original hack of shipping
two .desktop files.

Diff Detail

R124 System Settings
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
hein created this revision.Mar 10 2017, 4:39 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 10 2017, 4:39 PM
mart accepted this revision.Mar 10 2017, 4:42 PM
This revision is now accepted and ready to land.Mar 10 2017, 4:42 PM
graesslin edited edge metadata.Mar 10 2017, 5:46 PM

Does it still work on Wayland?

hein added a comment.Mar 10 2017, 6:23 PM

No idea (I can't start Wayland on Qt 5.9), but I don't see why it wouldn't. The two .desktop files are equal except the other one is NotShowIn=KDE.

This revision was automatically updated to reflect the committed changes.