Skip to content

Commit

Permalink
FIX: improve keybind detection to work with accelerator_parse versions
Browse files Browse the repository at this point in the history
that might return 3 results (e.g. Gnome 44) or 2 results (prior to Gnome
44).  Note: there is confusion in documentation when this change
   occurred so addressing all cases like this is preferable.
  • Loading branch information
jtaala committed May 29, 2023
1 parent 3ca6773 commit 19ec59c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,15 @@ function keystrToKeycombo(keystr) {
keystr = keystr.replace('Above_Tab', 'a');
aboveTab = true;
}
let [key, mask] = Gtk.accelerator_parse(keystr);

let ok, key, mask;
let result = Gtk.accelerator_parse(keystr);
if (result.length === 3) {
[ok, key, mask] = result;
}
else {
[key, mask] = result;
}

if (aboveTab)
key = META_KEY_ABOVE_TAB;
Expand Down

0 comments on commit 19ec59c

Please sign in to comment.