From 7269e8e04937301ec53cc368c4c3f5e9040c42e8 Mon Sep 17 00:00:00 2001 From: Ryo Nakano Date: Thu, 22 Jan 2026 20:09:01 +0900 Subject: [PATCH] Indicator: Fix setting max-volume key does not take effect --- src/Indicator.vala | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/Indicator.vala b/src/Indicator.vala index 1a756d5d..1b387e39 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -112,8 +112,6 @@ public class Sound.Indicator : Wingpanel.Indicator { Notify.init ("wingpanel-indicator-sound"); - settings.notify["max-volume"].connect (set_max_volume); - var locale = Intl.setlocale (LocaleCategory.MESSAGES, null); display_widget.volume_press_event.connect (volume_control.toggle_mute); @@ -153,16 +151,21 @@ public class Sound.Indicator : Wingpanel.Indicator { ); settings.changed.connect ((key) => { - if (key != "volume-up" && - key != "volume-down" && - key != "volume-mute" - ) { - return; - } + switch (key) { + case "volume-up": + case "volume-down": + case "volume-mute": + if (key_grabber != null) { + ungrab_keybindings (); + setup_grabs (); + } - if (key_grabber != null) { - ungrab_keybindings (); - setup_grabs (); + break; + case "max-volume": + set_max_volume (); + break; + default: + break; } }); }