From 3758e4aca539f975e0c1c5a03ae1cee64c9a1cb1 Mon Sep 17 00:00:00 2001 From: zhangkun Date: Thu, 29 Jan 2026 20:22:55 +0800 Subject: [PATCH] perf(sound): remove blocking delay in audio device switching MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove the 200ms blocking sleep (QThread::msleep) that was originally used for debouncing multiple signals during device switching. Analysis shows that valid signals arrive with sufficient intervals (>250ms), making the blocking delay unnecessary and harmful to UI responsiveness. 移除音频设备切换中的阻塞延迟 移除原本用于防抖多个信号的 200ms 阻塞延迟(QThread::msleep)。 分析表明有效信号到达的间隔已足够大(>250ms),使得阻塞延迟既不必要 又损害 UI 响应速度。 Log: remove blocking delay in audio device switching PMS: BUG-295929 --- plugins/dde-dock/sound/soundcontroller.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/dde-dock/sound/soundcontroller.cpp b/plugins/dde-dock/sound/soundcontroller.cpp index 472174627..17fa2bc2e 100644 --- a/plugins/dde-dock/sound/soundcontroller.cpp +++ b/plugins/dde-dock/sound/soundcontroller.cpp @@ -74,7 +74,6 @@ void SoundController::SetMute(bool in0) void SoundController::onDefaultSinkChanged(const QDBusObjectPath &path) { // 防止手动切换设备,与后端交互时,获取到多个信号,设备切换多次,造成混乱 - QThread::msleep(200); if (m_defaultSinkInter) m_defaultSinkInter->deleteLater();