src/mainwindow.cc

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 4 04:35:48 UTC 2025


 src/mainwindow.cc |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 1f58c43347c8fe36b88165064ba8196b477525ef
Author: Arun Raghavan <arun at asymptotic.io>
Date:   Tue Jun 3 09:23:41 2025 +0530

    Don't inhibit suspend on monitor sources
    
    This allows us to not keep sinks open if nothing else is connected.

diff --git a/src/mainwindow.cc b/src/mainwindow.cc
index 8a3f2f3..0f136f7 100644
--- a/src/mainwindow.cc
+++ b/src/mainwindow.cc
@@ -721,6 +721,7 @@ void MainWindow::updateSource(const pa_source_info &info) {
     const char *icon;
     std::map<uint32_t, CardWidget*>::iterator cw;
     std::set<pa_source_port_info,source_port_prio_compare> port_priorities;
+    SourceType type = info.monitor_of_sink != PA_INVALID_INDEX ? SOURCE_MONITOR : (info.flags & PA_SOURCE_HARDWARE ? SOURCE_HARDWARE : SOURCE_VIRTUAL);
 
     if (sourceWidgets.count(info.index))
         w = sourceWidgets[info.index];
@@ -736,7 +737,7 @@ void MainWindow::updateSource(const pa_source_info &info) {
         w->setVolumeMeterVisible(showVolumeMetersCheckButton->get_active());
 
         if (pa_context_get_server_protocol_version(get_context()) >= 13)
-            w->peak = createMonitorStreamForSource(info.index, -1, !!(info.flags & PA_SOURCE_NETWORK));
+            w->peak = createMonitorStreamForSource(info.index, -1, !!(info.flags & PA_SOURCE_NETWORK) || type == SOURCE_MONITOR);
     }
 
     w->updating = true;
@@ -744,7 +745,7 @@ void MainWindow::updateSource(const pa_source_info &info) {
     w->card_index = info.card;
     w->name = info.name;
     w->description = info.description;
-    w->type = info.monitor_of_sink != PA_INVALID_INDEX ? SOURCE_MONITOR : (info.flags & PA_SOURCE_HARDWARE ? SOURCE_HARDWARE : SOURCE_VIRTUAL);
+    w->type = type;
 
     w->boldNameLabel->set_text("");
     gchar *txt;



More information about the pulseaudio-commits mailing list