Skip to content

[Wayland] First keystroke lost after Alt+Tab with custom title bar #311819

Open

Description

@MingZaiTown

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.116.0
  • OS Version: Arch Linux, KDE Plasma on Wayland

Steps to Reproduce:

  1. Set window.titleBarStyle to custom in settings.
  2. Focus on the VSCode editor area.
  3. Use Alt+Tab to switch to another application.
  4. Switch back to VSCode (by either clicking the window with the mouse or using Alt+Tab again).
  5. Immediately start typing.

Observed Behavior:
The first character typed is swallowed (not inserted into the editor). Subsequent keystrokes work normally.

Expected Behavior:
The first character should appear in the editor as usual.

Additional Notes:

  • If I switch away and return using only the mouse (no Alt key involved), the bug does not occur.
  • If I switch away with the mouse and return with Alt+Tab, the bug does not occur.
  • This only happens when Alt+Tab is used to switch away from VSCode.
  • The following settings were tried but did not resolve the issue:
    • "window.customMenuBarAltFocus": false
    • "window.enableMenuBarMnemonics": false
  • Switching window.titleBarStyle to native fixes the issue, but that is not an acceptable workaround due to styling preferences.
  • The problem began after a recent update of the AUR package visual-studio-code-bin.
  • The issue seems related to how Electron handles the Alt key state upon regaining focus under Wayland.

Activity

  1. added
    titlebar
    on Apr 22, 2026
  2. jhanikhilnath commented on May 14, 2026

    @jhanikhilnath

    issue still persisting on v1.120.0 and fedora 44, KDE Plasma.

    any updates?

  3. atirutw commented on Jun 20, 2026

    @atirutw

    This is still a problem on 1.125.1. It also happens with the integrated terminal, and not just the editor.

  4. Mahkhmood9 commented on Jul 17, 2026

    @Mahkhmood9

    about 10 users , mentioed a simular issue

    about 5 users , said --disable-gpu , help them fix the issue

    the original user who suggested "--disable-gpu" does help their issue , now says window.titleBarStyle to another value --- also fixed it for him Vincent (@zhang-wenchao)

    "window.titleBarStyle" is mentioned here in this First Keystroke Lost?

    (e .g he likely doesnt like to open vs-code from the terminal so he search the issue more?)

    this spans over Codex/Vscode/elctron/Wayland

    more than 10 users have this issue also in codex-ide which is a very popular extention

    • if this can be debugged quickly its important

    personally I cant trace it to codex or vscode or wayland or electron

    openai/codex#32041 (comment)

    another comment by ai I find interesting --- my take on this manner? Its a systemd+wayland+electron issue then? can be temporarly patched in codex - or fixed in vscode or electron?

    Image
  5. Mahkhmood9 commented on Jul 17, 2026

    @Mahkhmood9

    Atirut Wattanamongkol (@atirutw) Nikhil Nath Jha (@jhanikhilnath) can you report if its still happening for you , maybe its something interduced?

    incase it is still happening can you try
    ulimit -n 65535 && exec ./code

    or using
    --disable-gpu

    and see if we have new new leads and observation ?

  6. lucassilvas1 commented on Jul 17, 2026

    @lucassilvas1

    One thing that solved this for me was to switch from IBUS to fcitx 5. That also solved a bunch of other issues as well.

  7. Mahkhmood9 commented on Jul 18, 2026

    @Mahkhmood9

    One thing that solved this for me was to switch from IBUS to fcitx 5. That also solved a bunch of other issues as well.

    WOW! thank you for this message I now know about fctx-5

    it solved me some weird issue I had for 2 years!

    THANKS!

  8. kai-maurik commented on Jul 24, 2026

    @kai-maurik

    This is also affecting me.
    OS: Fedora 44, KDE Plasma Spin
    VS: 1.125.1
    Setting window.titleBarStyle to natvie fixes the issue, but this is not desirable because it clutters the screen.

  9. Mahkhmood9 commented on Jul 25, 2026

    @Mahkhmood9

    This is also affecting me. OS: Fedora 44, KDE Plasma Spin VS: 1.125.1 Setting window.titleBarStyle to natvie fixes the issue, but this is not desirable because it clutters the screen.

    Interesting, please comment on the VSCODE issue thread, so this get more attention

    <3

  10. j-wiedemann commented on Oct 13, 2026

    @j-wiedemann

    I'm affected as well.

    Version: 1.141.0
    Commit: 2a59476c9bfcb90b3ddc372c36762471b7dfad1c
    Date: 2026-10-06T10:15:52+02:00
    Electron: 43.7.7
    ElectronBuildId: 15553055
    Chromium: 150.0.7871.250
    Node.js: 24.21.0
    V8: 15.0.245.31-electron.0
    @github/copilot: 1.0.92-4.unstable.r37397886721.gad270aa
    @github/copilot-sdk: 1.0.17.37397886721.gad270aa
    OS: Linux x64 7.0.0-38-generic
    
    Operating System: Ubuntu 26.04
    KDE Plasma Version: 6.6.6
    KDE Frameworks Version: 6.24.0
    Qt Version: 6.10.2
    Kernel Version: 7.0.0-38-generic (64-bit)
    Graphics Platform: Wayland
    

    Switching window.titleBarStyle to native fixes the issue...

  11. Mahkhmood9 commented on Oct 15, 2026

    @Mahkhmood9

    17. I'm affected as well.
    Version: 1.141.0 Commit: 2a59476c9bfcb90b3ddc372c36762471b7dfad1c Date: 2026-10-06T10:15:52+02:00 Electron: 43.7.7 ElectronBuildId: 15553055 Chromium: 150.0.7871.250 Node.js: 24.21.0 V8: 15.0.245.31-electron.0 @github/copilot: 1.0.92-4.unstable.r37397886721.gad270aa @github/copilot-sdk: 1.0.17.37397886721.gad270aa OS: Linux x64 7.0.0-38-generic

     ```
     Operating System: Ubuntu 26.04
     KDE Plasma Version: 6.6.6
     KDE Frameworks Version: 6.24.0
     Qt Version: 6.10.2
     Kernel Version: 7.0.0-38-generic (64-bit)
     Graphics Platform: Wayland
     ```
     
     
         
           
         
     
           
         
     
         
       
     Switching `window.titleBarStyle` to `native` fixes the issue...
    

    dude 141codex was like 2 years ago at this point........

  12. j-wiedemann commented on Oct 15, 2026

    @j-wiedemann

    Mahkhmood9 what do you mean ?

  13. Mahkhmood9 commented on Oct 29, 2026

    @Mahkhmood9

    19. Mahkhmood9 what do you mean ?

    no idea i forgot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions