[pulseaudio-commits] src/mainwindow.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Sep 19 09:14:34 UTC 2019


 src/mainwindow.cc |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 0dd27ba34728ffacf7a0e1183c930cebfa68412d
Author: Tanu Kaskinen <tanuk at iki.fi>
Date:   Thu Sep 19 11:37:11 2019 +0300

    mainwindow: set the updating flag later for sinks and sources
    
    The updating flag is used to determine whether a change in some UI
    control state is due to a user action or an update from the server. The
    flag was set to false too early when processing sink and source updates
    from the server. This caused at least unnecessary "set port" commands,
    because each update refreshes the port list, which generates change
    events in the port list combo box, causing the portChanged callbacks to
    be called.
    
    The unnecessary "set port" commands could even confuse the automatic
    port selection policies in the server. If the current port wasn't
    originally explicitly chosen by the user, then the "set port" command
    from pavucontrol will make the server think that the user explicitly
    chose that port.

diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 4b1cb8a..459ebbb 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -535,13 +535,13 @@ bool MainWindow::updateSink(const pa_sink_info &info) {
     w->setDigital(info.flags & PA_SINK_SET_FORMATS);
 #endif
 
-    w->updating = false;
-
     w->prepareMenu();
 
     if (is_new)
         updateDeviceVisibility();
 
+    w->updating = false;
+
     return is_new;
 }
 
@@ -698,12 +698,12 @@ void MainWindow::updateSource(const pa_source_info &info) {
     if (cw != cardWidgets.end())
         updatePorts(w, cw->second->ports);
 
-    w->updating = false;
-
     w->prepareMenu();
 
     if (is_new)
         updateDeviceVisibility();
+
+    w->updating = false;
 }
 
 void MainWindow::setIconFromProplist(Gtk::Image *icon, pa_proplist *l, const char *def) {



More information about the pulseaudio-commits mailing list