[gnome-settings-daemon] media-keys: Ignore our own output when omitting sound feedback



commit cf3ac24a12234b5f8919bc0139b06a54eba4dea4
Author: Florian Müllner <fmuellner gnome org>
Date:   Sat Mar 28 04:12:13 2020 +0100

    media-keys: Ignore our own output when omitting sound feedback
    
    Since commit 7d74327dc2b we omit sound feedback on volume changes
    if something is already outputting sound. Unfortunately that
    "something" may be our own feedback (from a previous volume
    change).
    
    We do not want to omit the feedback in that case, so only consider
    sound playing if something *else* is outputting sound.
    
    https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/508

 plugins/media-keys/gsd-media-keys-manager.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 7d3cdf54..d25f812e 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -1400,7 +1400,7 @@ show_volume_osd (GsdMediaKeysManager *manager,
         GvcMixerUIDevice *device;
         const GvcMixerStreamPort *port;
         const char *icon;
-        gboolean playing;
+        gboolean playing = FALSE;
         double new_vol;
         double max_volume;
 
@@ -1425,7 +1425,9 @@ show_volume_osd (GsdMediaKeysManager *manager,
                 show_osd_with_max_level (manager, icon, NULL, new_vol, max_volume, NULL);
         }
 
-        playing = gvc_mixer_stream_get_state (stream) == GVC_STREAM_STATE_RUNNING;
+        if (priv->ca)
+                ca_context_playing (priv->ca, 1, &playing);
+        playing = !playing && gvc_mixer_stream_get_state (stream) == GVC_STREAM_STATE_RUNNING;
 
         if (quiet == FALSE && sound_changed != FALSE && muted == FALSE && playing == FALSE)
                 play_volume_changed_audio (manager, stream);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]