[gnome-control-center/gnome-3-26] sound: Discard selection-changed events that are not triggered by the user



commit bddd95fc7a26a283dc8a89a1f58896c930d7ee94
Author: Andrea Azzarone <andrea azzarone canonical com>
Date:   Fri Oct 27 19:00:16 2017 +0200

    sound: Discard selection-changed events that are not triggered by the user
    
    The tree view in the input and the output tab uses the "selection-changed"
    signal. This implies that when a row is removed (e.g. when unplugging heaphones) g-c-c
    will receive the signal and try to change the active port. G-c-c should not be the one
    deciding deciding which port should be active, the user or PA are smart enough. We
    should descard selection-changed events that are not triggered by an user interaction.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=789551

 panels/sound/gvc-mixer-dialog.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/panels/sound/gvc-mixer-dialog.c b/panels/sound/gvc-mixer-dialog.c
index a358f03..b6d5f43 100644
--- a/panels/sound/gvc-mixer-dialog.c
+++ b/panels/sound/gvc-mixer-dialog.c
@@ -1410,6 +1410,9 @@ on_input_selection_changed (GtkTreeSelection *selection,
         guint             id;
         GvcMixerUIDevice *input;
 
+        if (gtk_get_current_event_device () == NULL)
+                return;
+
         if (gtk_tree_selection_get_selected (selection, &model, &iter) == FALSE) {
                 g_debug ("Could not get default input from selection");
                 return;
@@ -1440,6 +1443,9 @@ on_output_selection_changed (GtkTreeSelection *selection,
         guint             id;
         GvcMixerUIDevice *output;
 
+        if (gtk_get_current_event_device () == NULL)
+                return;
+
         if (gtk_tree_selection_get_selected (selection, &model, &iter) == FALSE) {
                 g_debug ("Could not get default output from selection");
                 return;


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