Don't inhibit suspend on monitor sources

This allows us to not keep sinks open if nothing else is connected.
This commit is contained in:
Arun Raghavan 2025-06-03 09:23:41 +05:30
parent b4af9ef7fa
commit 1f58c43347

View file

@ -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;