Skip to content

Commit

Permalink
GNOME mostly but not always defines media keys with a -static key
Browse files Browse the repository at this point in the history
So if a media key has not been specifically defined the bridge
should grab the -static key equivalent.
  • Loading branch information
fossfreedom committed Dec 27, 2024
1 parent f135420 commit 80521d1
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/bridges/labwc/labwc_bridge.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 80521d1

Please sign in to comment.