Bug 361965 - mpris integration not working with RDN launcherUrls
Summary: mpris integration not working with RDN launcherUrls
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-19 14:21 UTC by Harald Sitter
Modified: 2016-06-27 10:41 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.7.0


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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