microsoft / wslg

Enabling the Windows Subsystem for Linux to include support for Wayland and X server related scenarios
MIT License
9.96k stars 301 forks source link

"Sticky-Alt-Key": Alt-Key is not handled properly when using Alt-Tab task-switcher #162

Closed fflorey closed 3 years ago

fflorey commented 3 years ago

Environment

Windows 10 Pro, Windows 10 Feature Experience Pack 321.9601.0.3, Build: 21370.1 Microsoft Windows [Version 10.0.21370.1]

Ubuntu: Release: 20.04

Your WSLg version: [Open 'Apps and Features' and check the version of 'Windows Subsystem for Linux GUI app support', e.g: 0.2.3.13] ? -> 1.0.19 (?) (date: 2.5.21)



# Steps to reproduce

Start Ubuntu shell (i did that using Windows Terminal). 
Start gedit (or better: install VS Code under Linux)

Switch between applications using Alt-Tab

Take a look at the menu: Alt is activated (just like pressing Alt in the Window - even if you dont intended to do so!)

#  Expected behavior

No "hanging" Alt-Key event when switching to a a Linux GUI App. 

# Actual behavior

Feels like: Alt-Key is pressed *constantly* after switching to the Linux GUI App.

Seems to be no problem or nice to have? The issue here is: Try to use VS Code (as Linux GUI App), then switch between VS Code (Linux) and any other Application.  Switch back to VS Code (Linux App), using Alt-Tab. Now use your mouse to position your cursor in the editor.
This acts now just like: Alt-Key pressed: You place multiple cursors now in the editor (not intended). 

Workaround: Press ESC after each Alt-Tab Taskswitch to any Linux GUI App. (annoying, somehow)

As i said: Anyhow, GUI support is great work! Looking forward to any next version!
fflorey commented 3 years ago

It is working now, and i can't reproduce any longer, so i close this bug, which i reported

fflorey commented 3 years ago
It is working now, and i can't reproduce any longer, so i close this bug, which i reported

maarten-v commented 2 years ago

I'm having this bug and it's really annoying. I'm using phpstorm and lots of times when i switch back to phpstorm it is virtually holding the alt key, and when I click with my mouse it's creating extra curors because that's what phpstorm does when holding the alt key. Using WSLg version 1.0.26

JesusSave commented 2 years ago

I worked well with the laptop for half year now. But last week, I set up the desktop. I come across this same annoying feature, ALT key is halting after 'alt+tab' I need help! Welcome for any comments!

My computer details: Device name 1-039-11 Processor AMD Ryzen 9 5900X 12-Core Processor 3.70 GHz Installed RAM 32.0 GB Device ID D3418E8A-2C8C-4EC2-A836-7ABF7E5D9D51 Product ID 00330-71450-76029-AAOEM System type 64-bit operating system, x64-based processor Pen and touch No pen or touch input is available for this display

Edition Windows 11 Pro Version 21H2 Installed on ‎1/‎11/‎2022 OS build 22000.708 Experience Windows Feature Experience Pack 1000.22000.708.0

       .-/+oossssoo+/-.               chen@1-039-11 
    `:+ssssssssssssssssss+:`           ------------- 
  -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04 LTS on Windows 10 x86_64 
.ossssssssssssssssssdMMMNysssso.       Kernel: 5.10.102.1-microsoft-standard-WSL2 

/ssssssssssshdmmNNmmyNMMMMhssssss/ Uptime: 17 hours, 55 mins +ssssssssshmydMMMMMMMNddddyssssssss+ Packages: 1922 (dpkg) /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/ Shell: bash 5.1.16 .ssssssssdMMMNhsssssssssshNMMMdssssssss. Theme: Adwaita [GTK3] +sssshhhyNMMNyssssssssssssyNMMMysssssss+ Icons: Adwaita [GTK3] ossyNMMMNyMMhsssssssssssssshmmmhssssssso Terminal: terminator ossyNMMMNyMMhsssssssssssssshmmmhssssssso CPU: AMD Ryzen 9 5900X (24) @ 3.700GHz +sssshhhyNMMNyssssssssssssyNMMMysssssss+ GPU: 1092:00:00.0 Microsoft Corporation Device 008e .ssssssssdMMMNhsssssssssshNMMMdssssssss. Memory: 2023MiB / 15952MiB /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/ +sssssssssdmydMMMMMMMMddddyssssssss+
/ssssssssssshdmNNNNmyNMMMMhssssss/
.ossssssssssssssssssdMMMNysssso. -+sssssssssssssssssyyyssss+- :+ssssssssssssssssss+: .-/+oossssoo+/-.

rommeswi commented 2 years ago

I have the same problem as well (running spacemacs in gui mode). This issue should be reopened until it is better understood what the cause is.

JesusSave commented 2 years ago

Mine is fixed. I opened a post in StackExchange and got a simple solution https://superuser.com/a/1724453/1697720

use Microsoft Store install "Windows Subsystem for Linux Preview" to get latest features and get rid of sticky key problems.

rommeswi commented 2 years ago

I tried that and now there is a new problem (alt+tab out of the window needs to be pressed twice) and the display scaling is messed up. The .wslgconfig options WESTON_RDP_DISABLE_HI_DPI_SCALING and WESTON_RDP_DEBUG_DESKTOP_SCALING_FACTOR no longer work in the preview version leading to fuzzy fonds.

WannabeSmith commented 2 years ago

I have the same issue as @rommeswi.

BenedictHW commented 2 years ago

Mine is fixed. I opened a post in StackExchange and got a simple solution https://superuser.com/a/1724453/1697720

use Microsoft Store install "Windows Subsystem for Linux Preview" to get latest features and get rid of sticky key problems.

Had a sticky alt key that was driving me crazy in Emacs. This fixed it for me, thank you!

johnmcfarlane commented 2 years ago

The correct link is superuser.com/a/1724453/1697720 and this worked for me also. Simply install Windows Subsystem for Linux Preview from the Microsoft Store and restart your Linux instance.

@fflorey please consider reopening this issue until the fix is no longer in preview.

VJatla commented 1 year ago

UPDATE: 8/172022

The problem still persists. The only solution for now is upgrading to insider program and updating WSL to preview.

I was particularly frustrated as I use Emacs and there are many keys that work differently with Alt.

cayhorstmann commented 1 year ago

I just started using WSL2, and I have the same issue. Using Alt+Tab to get back to GTK Emacs makes Emacs think the Alt key is pressed. Issues such as this one prevent me from embracing WSL2 as a serious solution.

dmoncayo commented 1 year ago

I just started using WSL2, and I have the same issue. Using Alt+Tab to get back to GTK Emacs makes Emacs think the Alt key is pressed. Issues such as this one prevent me from embracing WSL2 as a serious solution.

Seconded. I'm experiencing this same issue.

Since I can't re-open this issue, I've just created a new one: https://github.com/microsoft/wslg/issues/899