Bug 361965

Summary: mpris integration not working with RDN launcherUrls
Product: [Plasma] plasmashell Reporter: Harald Sitter <sitter>
Component: Task Manager and Icons-Only Task ManagerAssignee: Eike Hein <hein>
Status: RESOLVED FIXED    
Severity: normal CC: kde, plasma-bugs
Priority: NOR    
Version: master   
Target Milestone: 1.0   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.7.0
Sentry Crash Report:

Description Harald Sitter 2016-04-19 14:21:34 UTC
launcherUrl in taskmanager is ideally the absolute desktop file there is stripping logic in place in the tooltipdelegate.qml 

>         readonly property string current: {
>             var split = launcherUrl.toString().split('/')
>             var appName = split[split.length - 1].replace(".desktop", "")
>             return appName
>         }

but this fails to strip RDNs (it supposedly shouldn't either because RDNs add uniqueness to the task that is lost when removing the RDN).

As a result org.kde.dragonplayer is not correctly mapped to the mpris source 'dragonplayer'.

To resolve this either the RDN should be stripped (which is a meh but probably acceptable approach) the most reliable solution would be to use the DesktopEntry property on the mpris interfaces [1] to get the actual desktop entry name associated with that mpris interface which then allows a 1:1 mapping between the launcherUrl and an mpris interface.

(Note: DesktopEntry() is optional so the existing way could still be adjusted to accomodate RDN and act as fallback if DesktopEntry is not present)

[1] https://specifications.freedesktop.org/mpris-spec/latest/Media_Player.html#Property:DesktopEntry

Reproducible: Always
Comment 1 Eike Hein 2016-04-19 14:27:00 UTC
Adding Kai to CC.

Your second proposal sounds better to me. RDN stripping is kinda bad. Also, application ids on Wayland are the desktop file name sans extension but including the RDN. MPRIS stuff should go with the times.
Comment 2 Eike Hein 2016-06-16 23:22:02 UTC
Harald, we fixed this right?
Comment 3 Harald Sitter 2016-06-17 08:30:19 UTC
Once landed https://phabricator.kde.org/D1916 should fix it.
Comment 4 Kai Uwe Broulik 2016-06-27 10:41:17 UTC
Git commit 0d6442d8374f87880de2aad044cd1563ed6fde75 by Kai Uwe Broulik.
Committed on 27/06/2016 at 10:38.
Pushed by broulik into branch 'Plasma/5.7'.

[Task Manager ToolTipDelegate] Match DesktopEntry for associating window/launcher with player

The current approach of matching the MPRIS DBus interface suffix was a bit short-sighted.
This patch makes it use the DesktopEntry provided by the application which should make it
work with most players.
FIXED-IN: 5.7.0

Differential Revision: https://phabricator.kde.org/D1916

M  +14   -5    applets/taskmanager/package/contents/ui/ToolTipDelegate.qml

http://commits.kde.org/plasma-desktop/0d6442d8374f87880de2aad044cd1563ed6fde75