From 09b5434d3c0a0cec28bee186605fd0f44f91ec31 Mon Sep 17 00:00:00 2001 From: Zhang Dingyuan Date: Tue, 7 Mar 2023 10:45:39 +0800 Subject: [PATCH] fix: unmute when changed volume Closed: https://github.com/linuxdeepin/developer-center/issues/3812 --- plugins/sound/sounddeviceswidget.cpp | 3 +++ plugins/sound/soundwidget.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/plugins/sound/sounddeviceswidget.cpp b/plugins/sound/sounddeviceswidget.cpp index 77f02a23d..86bc9faf0 100644 --- a/plugins/sound/sounddeviceswidget.cpp +++ b/plugins/sound/sounddeviceswidget.cpp @@ -204,6 +204,9 @@ void SoundDevicesWidget::initConnection() }); connect(m_sliderContainer, &SliderContainer::sliderValueChanged, this, [ this ](int value) { m_sinkInter->SetVolume(value * 0.01, true); + if (m_sinkInter->mute()) { + m_sinkInter->SetMuteQueued(false); + } }); } diff --git a/plugins/sound/soundwidget.cpp b/plugins/sound/soundwidget.cpp index ba05ed9c5..030e71316 100644 --- a/plugins/sound/soundwidget.cpp +++ b/plugins/sound/soundwidget.cpp @@ -84,6 +84,9 @@ void SoundWidget::initConnection() connect(m_sliderContainer, &SliderContainer::sliderValueChanged, this, [ this ](int value) { m_defaultSink->SetVolume(value * 0.01, true); + if (m_defaultSink->mute()) { + m_defaultSink->SetMuteQueued(false); + } }); connect(m_defaultSink, &DBusSink::MuteChanged, this, [ this ] {