[pulseaudio-commits] [Git][pulseaudio/pavucontrol][master] mainwindow: set the updating flag later for sinks and sources

Tanu Kaskinen gitlab at gitlab.freedesktop.org
Thu Sep 19 09:14:34 UTC 2019



Tanu Kaskinen pushed to branch master at PulseAudio / pavucontrol


Commits:
0dd27ba3 by Tanu Kaskinen at 2019-09-19T08:37:11Z
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.

- - - - -


1 changed file:

- src/mainwindow.cc


Changes:

=====================================
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) {



View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/commit/0dd27ba34728ffacf7a0e1183c930cebfa68412d

-- 
View it on GitLab: https://gitlab.freedesktop.org/pulseaudio/pavucontrol/commit/0dd27ba34728ffacf7a0e1183c930cebfa68412d
You're receiving this email because of your account on gitlab.freedesktop.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/pulseaudio-commits/attachments/20190919/b9795148/attachment-0001.html>


More information about the pulseaudio-commits mailing list