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

Conversation

Lythenas
Copy link
Collaborator

@Lythenas Lythenas commented May 29, 2023

Revert the one commit that fixed conflicting keybindings on Gnome 44 from #515

Fixes #533

Notes regarding testing: You need to relogin after you enable conflicting keybindings. They don't seem to be picked up without relogin if you reset your keybindings in the Gnome settings.

@Lythenas Lythenas marked this pull request as ready for review May 29, 2023 14:22
@Lythenas Lythenas added the gnome-43 Specific to GNOME Shell 43 label May 29, 2023
@@ -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.

@jtaala
Copy link
Collaborator

jtaala commented May 29, 2023

Thanks @Lythenas!

Unfortunately this PR also adds code that was never in versions prior to Gnome 44 (and never intended to be in previous versions) - and was only implemented as a temporary workaround since keybind clash detection in Gnome 44 was broken at the time (since fixed).

The only line/reversion needed in this PR is this line.

Closing this PR in favour of #539 since that one will implement a fix that is backwards compatible and works in Gnome 44, 43, 42.

Note: I'm also planning on adding changes in #539 to develop branch - hopefully bringing us closer to develop branch working just as well in prior version of gnome.

@jtaala jtaala closed this May 29, 2023
jtaala added a commit that referenced this pull request May 30, 2023
… earlier) keybind clash detection (#539)

See #537 #538 PR's which reverts changes that were backported to Gnome
43/42. This PR is a replacement for these individual reverts PRs.

This PR implements a fix which first checks the number elements returned
from Gtk.accelerator_parse (whether 2 or 3) and assigns them correctly.
This is a much better/robust fix that means that this should now work
regardless of what gnome version is used.

Fixes #533, #536.

The issue was caused by Gtk.accelerator_parse result changing in Gnome
44. There is confusion about when this change occurred, e.g. [GJS
porting
guide](https://gjs.guide/extensions/upgrading/gnome-shell-40.html#gtk-accelerator-parse)
suggests this change occurred in Gnome 40, however actually testing in
Fedora 37 (and purportedly in other Gnome 43, 42) versions it's still
returning 2 elements instead of 3.

This PR addresses both cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gnome-43 Specific to GNOME Shell 43
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants