In Windows 11 WSL Ubuntu 20.04, I am using the new WslG feature which allows native gtk apps to run smoothly on windows (and I compiled Emacs 29 with the
--with-pgtk option when installing), but I am running into the Alt (Meta) key randomly being stuck.
This most often occurs in this case (Alt+Tab is the shortcut to switch windows in Windows 11):
- Launch Emacs
- While active application is Emacs, use Alt+Tab to switch to the browser application
- Use Alt+Tab once more to switch back to Emacs
- Meta key is stuck in Emacs. E.g. just pressing
I have been able to get around the problem by pressing both Alt keys together, which returns emacs to the "normal" state in some cases, sometimes I have to repeat it a few times though. Is there some way to have Emacs automatically press both Alt (Meta) keys whenever I switch to the Emacs frame? Or some other elegant solution?