Skip to content

Commit 74b20ff

Browse files
committed
fix(keybinding): fix mute state conflict when volume is reduced to 0
When the volume is reduced to 0, changeSinkVolume first calls SetMute(false) to unmute, then SetVolume(0) internally calls SetMute(true) to mute again, resulting in a redundant DBus call and potential UI flicker of the mute state. 当音量减小到0时,changeSinkVolume中先调用SetMute(false)取消静音, 随后SetVolume(0)内部又调用SetMute(true)重新设置静音,导致一次 多余的DBus调用,并可能引起UI静音状态短暂闪烁。 Log: fix mute state conflict when volume is reduced to 0 Pms: BUG-350763
1 parent 6ac642c commit 74b20ff

1 file changed

Lines changed: 0 additions & 11 deletions

File tree

keybinding1/audio_controller.go

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -216,17 +216,6 @@ func (c *AudioController) changeSinkVolume(raised bool) error {
216216
}
217217

218218
logger.Debug("[changeSinkVolume] will set volume to:", v)
219-
mute, err := sink.Mute().Get(0)
220-
if err != nil {
221-
return err
222-
}
223-
224-
if mute {
225-
err = sink.SetMute(0, false)
226-
if err != nil {
227-
logger.Warning(err)
228-
}
229-
}
230219

231220
err = sink.SetVolume(0, v, true)
232221
if err != nil {

0 commit comments

Comments
 (0)