From 64c9baf412fa3709ab519d16caaec698db886ed0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Wed, 13 Nov 2024 00:42:56 +0100 Subject: [PATCH] status/backlight: Fix keynav within discrete item When representing the keyboard backlight levels as discrete items, it is currently not possible to keynav past the first button. Fix this by bypassing the usual event bubbling and passing key press events directly to the focus manager, similar to what we do for popup menu items. Part-of: --- js/ui/status/backlight.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/js/ui/status/backlight.js b/js/ui/status/backlight.js index 105aabc47..b39cfa632 100644 --- a/js/ui/status/backlight.js +++ b/js/ui/status/backlight.js @@ -133,6 +133,10 @@ const DiscreteItem = GObject.registerClass({ this._levelButtons.set(key, box); } + vfunc_key_press_event(event) { + return global.focus_manager.navigate_from_event(event); + } + _syncLevels() { this._levelButtons.get('off').visible = this.nLevels > 0; this._levelButtons.get('high').visible = this.nLevels > 1;