[taskmanager] Fix desktop file mapping for some apps
AbandonedPublic

Authored by nicolasfella on Mar 14 2019, 1:32 AM.

Details

Reviewers
hein
broulik
Group Reviewers
Plasma
Summary

Some apps (e.g. Nautilus) have more complex commands in their desktop file's Exec line (e.g. 'nautilus --new-window'). This breaks the cmd to desktop path mapping because =~ checks
for equality, but 'nautilus' isn't equal to 'nautilus --new-window'. Use ~~ instead which checks whether one string is contained in another
(https://techbase.kde.org/Development/Tutorials/Services/Traders#String_Matching_Operators).

The fault can be reproduced with:
ktraderclient5 --servicetype Application --constraint "exist Exec and ('nautilus' =~ Exec)
returns no matches

ktraderclient5 --servicetype Application --constraint "exist Exec and ('nautilus' ~~ Exec)
matches org.gnome.Nautilus

Same applies to Gedit and probably other apps.

As a result jumplist actions for Nautilus and Gedit are working in the taskmanager now

Diff Detail

Repository
R120 Plasma Workspace
Branch
fixnautilus
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9559
Build 9577: arc lint + arc unit
nicolasfella created this revision.Mar 14 2019, 1:32 AM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 14 2019, 1:32 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
nicolasfella requested review of this revision.Mar 14 2019, 1:32 AM
nicolasfella edited the summary of this revision. (Show Details)Mar 14 2019, 1:33 AM
nicolasfella edited the summary of this revision. (Show Details)
hein requested changes to this revision.Mar 14 2019, 7:21 AM

Sorry, that's too fast and loose for me.

Let's investigate why Nautilus and GEdit hit this fallback path in the first place instead of matching via preferred means?
Did you investigate by any chance why

This revision now requires changes to proceed.Mar 14 2019, 7:21 AM

Seems to match Nautilus and GEdit fine here. I have a nautilus.desktop and org.gnome.Nautilus.desktop on my system for some reason and it maps to nautilus.desktop

I did.

The usual path fails because the Nautilus window announces itself with Nautilus/nautilus as appId/wmClass, but the name defined in the desktop file is "Files". Other useful entries like StartupWmClass are not set at all. The only indication that "Files" actually is nautilus in the desktop file comes from the Exec line.

Same applies to Gedit

hein added a comment.Mar 17 2019, 4:26 PM

What's the name of the .desktop file though? That's the most relevant part.

The desktop files are called org.gnome.Nautilus.desktop and org.gnome.gedit.desktop

The problem seems gone with Nautilus and Gedit from master though

nicolasfella abandoned this revision.Apr 14 2020, 9:18 PM