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

Keyboard lags and repeats keys on Linux GUI Apps under WSLg #1140

Open
tkonsta opened this issue Nov 11, 2023 · 9 comments
Open

Keyboard lags and repeats keys on Linux GUI Apps under WSLg #1140

tkonsta opened this issue Nov 11, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@tkonsta
Copy link

tkonsta commented Nov 11, 2023

Windows build number:

10.0.22621.2428

Your Distribution version:

22.04

Your WSL versions:

WSL version: 2.0.7.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25880.1000-230602-1350.main
Windows version: 10.0.22621.2428

Steps to reproduce:

  1. Start a Linux GUI App inside of WSL (I first ran into the problem on IntelliJ, however I can reproduce it in gedit as well)
  2. Start typing something fast (if I type slow enough, then the problem doesn't appear)
  3. First some of the typed keys are just not showing up, and at some moment one arbitrary key is just repeated until I hit another key

WSL logs:

pulseaudio.log
stderr.log
weston.log

WSL dumps:

No response

Expected behavior:

No lagging keyboard and no repeated keystrokes

Actual behavior:

see "steps to reproduce"

Additional information

  • I experienced this problem first on a Ubuntu 22.04 distro, which I had in use for quite some time without the problem and all of a sudden this started to happen. Then I installed a fresh Ubuntu 23.10 distro thinking that maybe something within the installation is causing the problem, but the same thing happens again - in IntelliJ as well as in gedit.
  • The problem also occurred in WSL 1.x. So I did the update to the 2.x pre-release version with the hope that the problem might be gone in 2.x, but that's also not the case.
  • The same problem does not happen in all the programs running on windows. For example I use Visual Studio Code running on Windows, and using a project inside of WSL for coding and no problem at all.
  • I also experience on most of the WSL startups a problem in the weston.log which is discussed in After each reboot [WARN: COPY-MODE] happens, many program fails to start #972. However there seems no relation between the rdp_allocate_shared_memory problem discussed in the other issue and this problem here. Even if the rdp_allocate_shared_memory problem does not occur, this problem still exists. Maybe they have a common root cause, but one seems not to be leading to the other.
@tkonsta tkonsta added the bug Something isn't working label Nov 11, 2023
@tkonsta
Copy link
Author

tkonsta commented Nov 22, 2023

Now I had one WSL session where this worked as expected and there were no lags and no repeated letters. After shutting down the notebook and restarting it - thus restarting WSL - the problem exists again.

So the pattern looks similar (but not same) as the mentioned Weston problem (Failed to open "/mnt/shared_memory/{02...d0c}"). Sometimes (i.e. most of the times) the problem occurs, but sometimes not. Maybe some kind of race condition between the WSLg System distro and the user distro?

@atl-mk
Copy link

atl-mk commented Jul 31, 2024

I have this problem too, quite annoying. Starting to border on unusable to daily drive

@mentalisttraceur
Copy link

I've found myself experiencing this on a new laptop which I just set up. After installing all the available OS updates, I still have the problem, and ended up at this WSL version:

WSL version: 2.2.4.0
Kernel version: 5.15.153.1-2
WSLg version: 1.0.61
MSRDC version: 1.2.5326
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.26091.1-240325-1447.ge-release
Windows version: 10.0.22631.4112

Meanwhile, an old laptop which has the same exact wsl --version output is working fine.

@mentalisttraceur
Copy link

One super interesting thing I noticed: after one reboot, I got the "[WARN:COPY MODE]" window title issue, and while that was happening, the key input lag+repeat went away!

Then I rebooted and the warn-copy-mode went away and the key-lag-and-repeat returned.

@mentalisttraceur
Copy link

Reproduction advice: for me, this bug most reliably happens if

  1. I tap the same key twice very quickly, and
  2. right after switching to a WSLg window from a normal Windows window.

@mentalisttraceur
Copy link

For anyone else losing essential daily driver functionality to this, within a day I was able migrate over to GWSL and be back to my normal productivity.

It's a nice open source wrapper and management GUI to automate/ease most of the setup with VcXsrv. Currently you'll need to use the workaround from Opticos/GWSL-Source#184 , and I had to figure out my own command lines for shortcuts instead of being able to use its automatically-generated ones, but otherwise it Just Works and I'm now able to just move on.

@tkonsta
Copy link
Author

tkonsta commented Sep 9, 2024

In the meantime I can 100% reproduce this problem by enabling Microsoft PowerToys with the tool "Quick Accent" enabled. As soon as I enable "Quick Accent", the lagging in several WSLg UIs starts. As soon as I disable the tool again, it stops.

First I thought this could be because of the global shortcuts the tool uses. However, enabling the tool "Text Extractor", which also has a global shortcut, doesn't cause the issues.

@atl-mk
Copy link

atl-mk commented Sep 11, 2024

In the meantime I can 100% reproduce this problem by enabling Microsoft PowerToys with the tool "Quick Accent" enabled. As soon as I enable "Quick Accent", the lagging in several WSLg UIs starts. As soon as I disable the tool again, it stops.

OMG, I think it's working for me too. I've disabled it and haven't had any issues since.

@atl-mk
Copy link

atl-mk commented Sep 16, 2024

It seems to have made it better, but I've just experienced the same symptoms with it disabled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants