From 19ec59c3503679edfc71d6cd1d879c08ba9105ce Mon Sep 17 00:00:00 2001 From: Jay Ta'ala Date: Tue, 30 May 2023 07:37:55 +1000 Subject: [PATCH] FIX: improve keybind detection to work with accelerator_parse versions 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. --- settings.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/settings.js b/settings.js index 3c0049c2..81e5ab07 100644 --- a/settings.js +++ b/settings.js @@ -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;