Skip to content

Commit

Permalink
FIX: found root cause of keybind clashes! Was caused by method signature
Browse files Browse the repository at this point in the history
mismatch on Gtk.accelerator_parse.
  • Loading branch information
jtaala committed May 19, 2023
1 parent 3d0f25e commit 1ac33b4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 27 deletions.
27 changes: 1 addition & 26 deletions keybindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,32 +575,8 @@ 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);
Expand Down Expand Up @@ -734,7 +710,6 @@ function resetConflicts() {
}

function enable() {
disableKnownClashes();
let schemas = [...Settings.conflictSettings,
convenience.getSettings(KEYBINDINGS_KEY)];
schemas.forEach(schema => {
Expand Down
2 changes: 1 addition & 1 deletion settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function keystrToKeycombo(keystr) {
keystr = keystr.replace('Above_Tab', 'A');
aboveTab = true;
}
let [key, mask] = Gtk.accelerator_parse(keystr);
let [accel, key, mask] = Gtk.accelerator_parse(keystr);

if (aboveTab)
key = META_KEY_ABOVE_TAB;
Expand Down

0 comments on commit 1ac33b4

Please sign in to comment.