Skip to content

Commit 05feb21

Browse files
committed
audio: only show mic volume OSD through DMS IPCs, not external source
changes fixes AvengeMedia#2790 port 1.5
1 parent a3b2167 commit 05feb21

3 files changed

Lines changed: 13 additions & 2 deletions

File tree

quickshell/Modules/DankBar/Widgets/ControlCenterButton.qml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ BasePill {
255255
const newVolume = delta > 0 ? Math.min(100, currentVolume + step) : Math.max(0, currentVolume - step);
256256
AudioService.source.audio.muted = false;
257257
AudioService.source.audio.volume = newVolume / 100;
258+
AudioService.micVolumeChanged();
258259
}
259260

260261
function handleBrightnessWheel(delta) {

quickshell/Modules/OSD/MicVolumeOSD.qml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ DankOSD {
2323
Connections {
2424
target: AudioService.source?.audio ?? null
2525

26+
// Sync only - apps adjusting mic gain (WebRTC AGC etc.) fire this
27+
// constantly, so external volume changes must not surface the OSD
2628
function onVolumeChanged() {
2729
root._syncVolume();
28-
if (SettingsData.osdMicVolumeEnabled)
29-
root.show();
3030
}
3131

3232
function onMutedChanged() {
@@ -38,6 +38,12 @@ DankOSD {
3838
Connections {
3939
target: AudioService
4040

41+
function onMicVolumeChanged() {
42+
root._syncVolume();
43+
if (SettingsData.osdMicVolumeEnabled)
44+
root.show();
45+
}
46+
4147
function onSourceChanged() {
4248
root._syncVolume();
4349
if (root.shouldBeVisible && SettingsData.osdMicVolumeEnabled)

quickshell/Services/AudioService.qml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ Singleton {
6161
readonly property int wheelVolumeStep: SettingsData.audioWheelScrollAmount
6262

6363
signal micMuteChanged
64+
signal micVolumeChanged
6465
signal audioOutputCycled(string deviceName, string deviceIcon)
6566
signal deviceAliasChanged(string nodeName, string newAlias)
6667
signal wireplumberReloadStarted
@@ -905,6 +906,7 @@ EOFCONFIG
905906

906907
const clampedVolume = Math.max(0, Math.min(100, percentage));
907908
root.source.audio.volume = clampedVolume / 100;
909+
micVolumeChanged();
908910
return `Microphone volume set to ${clampedVolume}%`;
909911
}
910912

@@ -929,6 +931,7 @@ EOFCONFIG
929931
const newVolume = Math.max(0, Math.min(100, currentVolume + stepValue));
930932

931933
root.source.audio.volume = newVolume / 100;
934+
micVolumeChanged();
932935
return `Microphone volume increased to ${newVolume}%`;
933936
}
934937

@@ -944,6 +947,7 @@ EOFCONFIG
944947
const newVolume = Math.max(0, Math.min(100, currentVolume - stepValue));
945948

946949
root.source.audio.volume = newVolume / 100;
950+
micVolumeChanged();
947951
return `Microphone volume decreased to ${newVolume}%`;
948952
}
949953

0 commit comments

Comments
 (0)