diff options
author | Bastien Nocera <hadess@hadess.net> | 2018-01-24 17:22:24 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2018-02-02 16:28:00 +0100 |
commit | 3a64890a35c2b7218c8830b3ccc817841a2ee338 (patch) | |
tree | b0e4e4290f5fd40ff9a547b1daf8474ad1f1d1b1 | |
parent | be0fb7141524bf73b78674e83f66514befe9c290 (diff) | |
download | gnome-settings-daemon-3a64890a35c2b7218c8830b3ccc817841a2ee338.tar.gz |
media-keys: Prefer MPRIS clients to g-s-d ones
When there is an MPRIS client, prefer it to clients using the
gnome-settings-daemon interface. MPRIS clients are always media clients,
and it's likely that the user wants the media keys to control music or
movie playback, rather than presentations.
This will make mixing and matching the 2 different types of clients
(for example, Spotify and Rhythmbox) always control the MPRIS client,
but it's more than likely what the users want.
See https://bugzilla.gnome.org/show_bug.cgi?id=789738
https://bugzilla.gnome.org/show_bug.cgi?id=792875
-rw-r--r-- | plugins/media-keys/gsd-media-keys-manager.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c index ca98dfd9..1ad3f3df 100644 --- a/plugins/media-keys/gsd-media-keys-manager.c +++ b/plugins/media-keys/gsd-media-keys-manager.c @@ -1651,13 +1651,17 @@ gsd_media_player_key_pressed (GsdMediaKeysManager *manager, g_debug ("Media key '%s' pressed", key); + /* Prefer MPRIS players to those using the native API */ + if (mpris_controller_get_has_active_player (manager->priv->mpris_controller)) { + if (mpris_controller_key (manager->priv->mpris_controller, key)) + return TRUE; + } + have_listeners = (manager->priv->media_players != NULL); if (!have_listeners) { - if (!mpris_controller_key (manager->priv->mpris_controller, key)) { - /* Popup a dialog with an (/) icon */ - show_osd (manager, "action-unavailable-symbolic", NULL, -1, OSD_ALL_OUTPUTS); - } + /* Popup a dialog with an (/) icon */ + show_osd (manager, "action-unavailable-symbolic", NULL, -1, OSD_ALL_OUTPUTS); return TRUE; } |