Skip to content

Commit 5198900

Browse files
committed
keybindings: Make Above_Tab displayable.
The "Above_Tab" descriptor only exists in muffin's keybinding handling. Keyboard layouts are all different but the position should be the same for the default switch-group and switch-group- backward keybindings. When muffin handles an action using this Above_Tab assignment, it will figure out what that key is for the current keyboard layout automatically. If you re-teach those keybindings using the key above your tab, it will be displayed in the proper form (Alt+` for US), and the automation above will no longer occur - the keybinding will be layout specific. Resetting it to default (right-click the keybinding description) will restore the original behavior. This change is only visual to show that the keybindings aren't actually 'unassigned' (because gtk_accelerator_parse_with_keycode() doesn't know what Above_Tab means). Fixes #11778.
1 parent 3e9079a commit 5198900

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

files/usr/share/cinnamon/cinnamon-settings/bin/KeybindingWidgets.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,18 @@ def do_set_property(self, prop, value):
179179
def update_label(self):
180180
text = _("unassigned")
181181
if self.accel_string:
182-
key, codes, mods = Gtk.accelerator_parse_with_keycode(self.accel_string)
182+
restore_atab = False
183+
valid = self.accel_string
184+
if "Above_Tab" in valid:
185+
restore_atab = True
186+
valid = valid.replace("Above_Tab", "grave")
187+
188+
key, codes, mods = Gtk.accelerator_parse_with_keycode(valid)
183189
if codes is not None and len(codes) > 0:
184190
text = Gtk.accelerator_get_label_with_keycode(None, key, codes[0], mods)
191+
if restore_atab:
192+
text = text.replace("`", "AboveTab")
193+
185194
self.set_property("text", text)
186195

187196
def set_value(self, accel_string=None):

0 commit comments

Comments
 (0)