Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix conflicting keybindings on Gnome 43 #537

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion keybindings.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -710,6 +734,7 @@ 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 [ok, key, mask] = Gtk.accelerator_parse(keystr);
let [key, mask] = Gtk.accelerator_parse(keystr);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Lythenas!

This should be the only change (revert) needed to fix gnome 43, 42 keybind regressions.


if (aboveTab)
key = META_KEY_ABOVE_TAB;
Expand Down