From 80521d11db2b10737c13003d96b79f3a29323529 Mon Sep 17 00:00:00 2001 From: David Mohammed Date: Fri, 27 Dec 2024 19:44:43 +0000 Subject: [PATCH] GNOME mostly but not always defines media keys with a -static key So if a media key has not been specifically defined the bridge should grab the -static key equivalent. --- src/bridges/labwc/labwc_bridge.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/bridges/labwc/labwc_bridge.py b/src/bridges/labwc/labwc_bridge.py index 5d9e41a7a..d690aa480 100644 --- a/src/bridges/labwc/labwc_bridge.py +++ b/src/bridges/labwc/labwc_bridge.py @@ -637,6 +637,8 @@ def calc_keybind(self, gkey): if replacement[-1] == "-": replacement = replacement[:-1] + replacement = replacement.replace("XF86XF86", "XF86") + return replacement # all keybinds from various gsettings schemas are managed @@ -667,6 +669,17 @@ def keybindings_changed(self, settings, key): for bridge in root.findall(path): bridge.attrib["key"] = self.calc_keybind(keybind[0]) + # GNOME defines settings-daemon media keys also with a -static suffix - if + # the key we calculate is "undefined" then grab the value + # from the equivalent -static gsettings key + # ... in most keys - so skip those keys that don't have -static suffixes here + if bridge.attrib["key"] == "undefined" and settings == self.gsd_media_keys_settings: + try: + keybind = settings[key + "-static"] + bridge.attrib["key"] = self.calc_keybind(keybind[0]) + except KeyError: + pass + self.write_config() # all solus-project panel gsettings changes are managed