From c07add165b586998d1972d08964c9a45fc03c2f8 Mon Sep 17 00:00:00 2001 From: Lythenas Date: Mon, 29 May 2023 16:16:00 +0200 Subject: [PATCH] Revert "FIX: found root cause of keybind clashes! Was caused by method signature" This reverts commit 1ac33b4620c1cecc9578eab50b92fbe2ee109673. --- keybindings.js | 27 ++++++++++++++++++++++++++- settings.js | 2 +- 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/keybindings.js b/keybindings.js index e5f9de72..735797fb 100644 --- a/keybindings.js +++ b/keybindings.js @@ -574,8 +574,32 @@ function overrideAction(mutterName, action) { actionIdMap[id] = action; } +/** + * Disables known keybind clashes with default gnome operations. + */ +function disableKnownClashes() { + // disable specific actions known to cause issues + const mutterbinds = convenience.getSettings('org.gnome.mutter.keybindings'); + [ + 'toggle-tiled-left', 'toggle-tiled-right' + ].forEach(key => { + try { + mutterbinds.set_value(key, new GLib.Variant('as', [])); + } catch (e) {} + }); + + const wmbinds = convenience.getSettings('org.gnome.desktop.wm.keybindings'); + [ + 'switch-group', 'switch-group-backward', + 'switch-to-workspace-left', 'switch-to-workspace-right', + ].forEach(key => { + try { + wmbinds.set_value(key, new GLib.Variant('as', [])); + } catch (e) {} + }); +} + function resolveConflicts() { - resetConflicts(); for (let conflict of Settings.findConflicts()) { let {name, conflicts} = conflict; let action = byMutterName(name); @@ -710,6 +734,7 @@ function resetConflicts() { } function enable() { + disableKnownClashes(); let schemas = [...Settings.conflictSettings, convenience.getSettings(KEYBINDINGS_KEY)]; schemas.forEach(schema => { diff --git a/settings.js b/settings.js index 023ff9a4..3c0049c2 100644 --- a/settings.js +++ b/settings.js @@ -242,7 +242,7 @@ function keystrToKeycombo(keystr) { keystr = keystr.replace('Above_Tab', 'a'); aboveTab = true; } - let [ok, key, mask] = Gtk.accelerator_parse(keystr); + let [key, mask] = Gtk.accelerator_parse(keystr); if (aboveTab) key = META_KEY_ABOVE_TAB;