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

[Gnome 46]: switching to a workspace makes the non-contrl key "stick" #279

Open
vladzcloudius opened this issue Apr 26, 2024 · 24 comments
Open

Comments

@vladzcloudius
Copy link

vladzcloudius commented Apr 26, 2024

Configuration

OS: Ubuntu 24.04
Grid config: 2x4
Extension version: 44

Description

I use Ctrl+Alt+Arrow X keybinding to switch between workspaces.
With U24.04 when I switch to a workspace in the direction X the "Arrow X" key "sticks": e.g. if a destination workspace has a text editor open then the cursor is going to move in the corresponding direction.

I verified that this has nothing to do with arrow keys: I configured a Ctrl+Alt+m to be a shortcut to switch to the workspace above and the issue reproduced: letter 'm' began to be printed endlessly until I press another key on the keyboard.

@vladzcloudius
Copy link
Author

cc @mzur

@andersjohansson
Copy link
Contributor

I also experience this, but I have only seen it in Signal (an electron application) so I thought it was a bug there. Yes, tested in chromium as well, and it appears there as well (about every third workspace switch), so perhaps it is some kind of interaction between chrome/electron and wayland/gnome that goes wrong?

@vladzcloudius
Copy link
Author

vladzcloudius commented Apr 29, 2024

I also experience this, but I have only seen it in Signal (an electron application) so I thought it was a bug there. Yes, tested in chromium as well, and it appears there as well (about every third workspace switch),

@andersjohansson, I was reproducing it with JetBrain tools family: Clion, PyCharm, etc.
These are java applications and it reproduces close to 100% of the time.

I wasn't able to reproduce it with built-in Terminal and Text Editor Gnome applications however.

so perhaps it is some kind of interaction between chrome/electron and wayland/gnome that goes wrong?

It's clearly related to the Workspace Matrix extension - when I disable it the issue never reproduces.

@matttbe
Copy link
Contributor

matttbe commented May 1, 2024

Same here with GNOME 46: I have the same issue with Thunderbird and Firefox, but not with "native" Gnome apps like the terminal, nautilus and the text editor.

(Great extension BTW, hard to keep it disabled :) )

@vmarchaud
Copy link

I've tested around few options and it seems that when disabling the popup it doesn't trigger the bug if that can helps narrow down the issue

@mzur
Copy link
Owner

mzur commented May 1, 2024

I'll probably have a look once I migrated to GNOME Shell 46 myself.

@vladzcloudius
Copy link
Author

I've tested around few options and it seems that when disabling the popup it doesn't trigger the bug if that can helps narrow down the issue

Yup, that's how I worked this around as well: I set "time to show the popup" to 1 and it stopped reproducing.

@longwave
Copy link

Also seeing this since upgrading to Ubuntu 24.04 with GNOME 46, disabling the popup works for me too.

@alexbrouwer
Copy link

I've tested around few options and it seems that when disabling the popup it doesn't trigger the bug if that can helps narrow down the issue

Yup, that's how I worked this around as well: I set "time to show the popup" to 1 and it stopped reproducing.

Me too. Upgraded to Ubuntu 24.04 with GNOME 46. Same issue. In my case mostly when navigating to the workspace with my IDE (Intellij) on it. Disabling the popup seems to work as a workaround.

Love to see a solution to make my favorite extension 100% usable again!

@tmortagne
Copy link

tmortagne commented May 29, 2024

I finally notice this mess (random keys and mouse going crazy in various softwares, especially browsers) after upgrading to Ubuntu 24.04 was happening shortly after switching from one workspace to another and found this issue. Thanks for the explanation @vladzcloudius.

This problem unfortunately makes this extension unusable, so I hope it will get fixed. I'm a bit lost without my grid of workspaces :)

Note: I reported https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/2067260 before understanding the source of the problem.

@gurupras
Copy link

gurupras commented May 30, 2024

I am running into this far too much and am willing to put in some effort to track this down.
But I have never worked on GNOME extensions before. If you can give me a brief set of instructions on how I can go about investigating this, I am happy to do run through the steps and report back.

FWIW, I tried the "time to show the popup" period of 1s and that didn't make the problem go away. I was originally on 500ms.

@vmarchaud
Copy link

I am running into this far too much and am willing to put in some effort to track this down. But I have never worked on GNOME extensions before. If you can give me a brief set of instructions on how I can go about investigating this, I am happy to do run through the steps and report back.

FWIW, I tried the "time to show the popup" period of 1s and that didn't make the problem go away. I was originally on 500ms.

There are some instructions over the readme https://github.com/mzur/gnome-shell-wsmatrix#developing

@vmarchaud
Copy link

I've tried to investigate a bit although i never worked on gnome extensions before:

  • The problem lies not in the popup itself but the fact that we are switching more than one workspace at once which trigger the bug, just going to right (or left) and back is enough.
  • By "once" i mean triggering a switch while already switching and the popup is still visible, a mean to verify this is to reduce the time the popup appears to < 100ms and the bug will be way harder to reproduce.
  • From my debugging, it seems taht the first "switch" trigger this code path but i'm can't find from where (there is only one place that this function is called and i also had a log that didn't print), while the second trigger this one which calls the previous mentioned function and then trigger the bug.

I've also looked at @mzur changes for gnome 46 and i don't see (obviously from someone that never saw a gnome extension previously so to take with a pinch of salt) any changes that would explain this so i suspect this comes from gnome itself. Can't go any further as i have no idea how to continue debugging :/

@vakker
Copy link

vakker commented Jun 5, 2024

Same issue, I'm glad it's not just me!
One thing to add, I found xev very helpful to debug, it shows specifically which keys are registered by the system.
For the time being, disabling the pop-up works around this.

@Atko
Copy link

Atko commented Jun 7, 2024

Same here: Ubuntu 24.04, Gnome 46, disabling popup solves the "sticky key" issue.

@vmarchaud
Copy link

One of my coworker just had a similar issue where the ctrl key was blocked, however he wasn't using wsmatrix so it may well be a gnome issue

@itsrachelfish
Copy link

Using Ubuntu 24.04 on a brand new Framework laptop and I was able to replicate this issue.

Thanks for the suggestion for disabling the popup in workspace matrix. I like seeing the preview, but keys getting stuck is a major hassle.

@stelian42
Copy link

Same here, same comments as @itsrachelfish

@ebeem
Copy link
Collaborator

ebeem commented Jul 15, 2024

There was a race condition that I believe still exists in grabbing the release of the modifier key (like alt).
My previous commits didn't properly comment such behaviors, I think the code was simplified later but this race condition was not taken into account.

Review more about the issue here: https://bugzilla.gnome.org/show_bug.cgi?id=596695
If someone is willing to test and fix it (I am not 100% sure this is actually the problem, it's just a guess), you can try reverting the commit here dc813d7.

Unfortunately, I am not using gnome anymore so I can't test myself, but thought I might be able to give a hint.

Note: This in fact is a mutter/gnome issue, it impacts all other modifier key release behavior in gnome, and they all implement a similar workaround to function properly

@scottkosty
Copy link

I experience this issue, as described by others.

Can someone give me an ELI5 version of how to test @ebeem's theory (just above this comment)? I know nothing about gnome extensions. I see the following file on my computer: /home/scott/.local/share/gnome-shell/extensions/[email protected]/workspacePopup/workspaceSwitcherPopup.js. Is it sufficient to edit that file? How do I then reinitialize the extension without restarting my computer so I can quickly test?

@scottkosty
Copy link

Disabling the popup indeed works, but if anyone prefers, I found that setting the "time to show the the popup" to 50 ms also eliminated the issue and still gives me at least an idea of where I am in my messing workspaces.

@mzur
Copy link
Owner

mzur commented Jul 27, 2024

@scottkosty Thanks for testing! You can just edit the file and restart GNOME (explained here).

@scottkosty
Copy link

Thanks! I tested the proposed change but can still reproduce the issue with the change.

@sandroden
Copy link

sandroden commented Aug 3, 2024

Same problems as described above.

I tested the solution and I already posted a positive feedback, but after some time I'm back with the same problems.

To me the proposed solution solved the issue. Thanks a lot.

I'm using Ubuntu 24.04 with wayland.
I also noticed that Control key was not released only if I double-hit the arrows fast enough. Doing it slowly doesn't show the issue. When Control is not released scrolling the wheel enlarges or reduces the font on browsers. I also experiment the issue that the page is scrolled completely to the beginning and that the pointer in textareas goes to the start of the area. A simple "Esc" fixes it till next time you press Control-Alt-arrow fast enough (that is pretty normal).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests