From 05feb211ba28a2c888690fdb16f75e5dbd335b30 Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 10 Jul 2026 12:43:07 -0400 Subject: [PATCH] audio: only show mic volume OSD through DMS IPCs, not external source changes fixes #2790 port 1.5 --- .../Modules/DankBar/Widgets/ControlCenterButton.qml | 1 + quickshell/Modules/OSD/MicVolumeOSD.qml | 10 ++++++++-- quickshell/Services/AudioService.qml | 4 ++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml b/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml index 97044f45c..2417bc2d3 100644 --- a/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml +++ b/quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml @@ -255,6 +255,7 @@ BasePill { const newVolume = delta > 0 ? Math.min(100, currentVolume + step) : Math.max(0, currentVolume - step); AudioService.source.audio.muted = false; AudioService.source.audio.volume = newVolume / 100; + AudioService.micVolumeChanged(); } function handleBrightnessWheel(delta) { diff --git a/quickshell/Modules/OSD/MicVolumeOSD.qml b/quickshell/Modules/OSD/MicVolumeOSD.qml index e23d0fb10..32a6d8567 100644 --- a/quickshell/Modules/OSD/MicVolumeOSD.qml +++ b/quickshell/Modules/OSD/MicVolumeOSD.qml @@ -23,10 +23,10 @@ DankOSD { Connections { target: AudioService.source?.audio ?? null + // Sync only - apps adjusting mic gain (WebRTC AGC etc.) fire this + // constantly, so external volume changes must not surface the OSD function onVolumeChanged() { root._syncVolume(); - if (SettingsData.osdMicVolumeEnabled) - root.show(); } function onMutedChanged() { @@ -38,6 +38,12 @@ DankOSD { Connections { target: AudioService + function onMicVolumeChanged() { + root._syncVolume(); + if (SettingsData.osdMicVolumeEnabled) + root.show(); + } + function onSourceChanged() { root._syncVolume(); if (root.shouldBeVisible && SettingsData.osdMicVolumeEnabled) diff --git a/quickshell/Services/AudioService.qml b/quickshell/Services/AudioService.qml index beb47ff2f..f158fbb34 100644 --- a/quickshell/Services/AudioService.qml +++ b/quickshell/Services/AudioService.qml @@ -61,6 +61,7 @@ Singleton { readonly property int wheelVolumeStep: SettingsData.audioWheelScrollAmount signal micMuteChanged + signal micVolumeChanged signal audioOutputCycled(string deviceName, string deviceIcon) signal deviceAliasChanged(string nodeName, string newAlias) signal wireplumberReloadStarted @@ -905,6 +906,7 @@ EOFCONFIG const clampedVolume = Math.max(0, Math.min(100, percentage)); root.source.audio.volume = clampedVolume / 100; + micVolumeChanged(); return `Microphone volume set to ${clampedVolume}%`; } @@ -929,6 +931,7 @@ EOFCONFIG const newVolume = Math.max(0, Math.min(100, currentVolume + stepValue)); root.source.audio.volume = newVolume / 100; + micVolumeChanged(); return `Microphone volume increased to ${newVolume}%`; } @@ -944,6 +947,7 @@ EOFCONFIG const newVolume = Math.max(0, Math.min(100, currentVolume - stepValue)); root.source.audio.volume = newVolume / 100; + micVolumeChanged(); return `Microphone volume decreased to ${newVolume}%`; }