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):

  1. Launch Emacs
  2. While active application is Emacs, use Alt+Tab to switch to the browser application
  3. Use Alt+Tab once more to switch back to Emacs
  4. Meta key is stuck in Emacs. E.g. just pressing x registers as M-x in Emacs

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?

  • Are you sure it’s not just a sticky key on your keyboard?
    – db48x
    Commented Jun 29, 2022 at 20:27
  • @db48x yes, alt (meta) key works everywhere else. It's probably a bug with how WSLg is implemented.
    – herophant
    Commented Jun 29, 2022 at 21:37

1 Answer 1


This is a known issue in WSLg. See the opened issue here: https://github.com/microsoft/wslg/issues/162

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.