Media controls unable to raise Spotify when installed from flatpak
I've reported the problem to Flathub (https://github.com/flathub/com.spotify.Client/issues/136) but maybe this is a more Shell related thing, I can't tell.
The DesktopEntry
value I get from Spotify is spotify
:
~:: dbus-send --print-reply --session --dest=org.mpris.MediaPlayer2.spotify /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2' string:'DesktopEntry'
method return time=1600304132.873396 sender=:1.92 -> destination=:1.93 serial=45 reply_serial=2
variant string "spotify"
And the relevant code in mpris.js uses that property to find and activate an app:
if (this._mprisProxy.DesktopEntry) {
let desktopId = '%s.desktop'.format(this._mprisProxy.DesktopEntry);
app = Shell.AppSystem.get_default().lookup_app(desktopId);
}
if (app)
app.activate();
else if (this._mprisProxy.CanRaise)
this._mprisProxy.RaiseRemote();
Notice that CanRaise
is false in both deb and flatpak versions and that Raise
doesn't work in either of them. So the fact that the deb version is raised must be explained by the app.activate()
part.