Skip to content

[Bug]: Linux Electron 12 always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys #28088

Closed

Description

@MurzNN

Preflight Checklist

Electron Version

12.0.0

What operating system are you using?

Ubuntu

Operating System Version

20.04

What arch are you using?

x64

Last Known Working Electron version

5.x

Expected Behavior

When user change keyboard layout via Alt+Ctrl or Alt+Shift hotkeys, it should just change keyboard layout and have no effect on any focused Electron input elements.

Actual Behavior

At every layout changing on any input element (textarea, input, etc) - it lose focus, so users can't continue typing text, and need manually click on input element to restore focus and continue typing. This is very annoying for all non-English users!

Testcase Gist URL

https://github.com/geeksesi/time_reminder

Additional Information

How to reproduce:

  1. Add any second keyboard layout in KDE settings, default hotkey for switch will be "Alt+Shift".

  2. Open any app, using Electron 12.0 version, for example "Quick start" app.

  3. Make focus on any input element, start typing some text.

  4. Press "Alt+Shift" and try continue typing, you will can't, because element lose focus! Via "Alt" key press Electron activates app menu, and you can press "Esc" for deactivate it and continue typing, or click via mouse on element.

Screenshot of problem:

How to workaround:

Downgrade Electron application to 5.x or earlier versions of Electron, and this issue will not reproduced!

Right solution

Please investigate source of this issue and fix this regression on fresh Electron versions!

P.S. Here is the clone of #22213 that is closed without any reasons! Also some Electron 4.x apps was have similar issue, that can be fixed via workaround with adding keyboard shortcuts to all menu elements (here is example of fix: element-hq/element-web#4345), but this workaround stops working on Electron 6.x+ versions.

Similar reports, depending on this issue:

Activity

  1. MurzNN commented on Mar 10, 2021

    @MurzNN
    Author
  2. added
    has-repro-repo
    on Mar 10, 2021
  3. hotsezus commented on Mar 10, 2021

    @hotsezus

    There's also another issue closed
    #11106 (comment)

  4. geeksesi commented on Mar 16, 2021

    @geeksesi

    i found something.
    if you press alt (first and don't release ) + shift ( pres and release then release alt ). there is no problem.

    but my habit is this : press alt ( first and don't release ) + press shift and release alt then release shift.

    we should change shift action to press ( now will act to shift when you release it ). ( i think can't do this )

    just make an event for ( presed alt + presed shift ) and prevent it to default ¯_(ツ)_/¯

  5. isaacvonaaron commented on Mar 24, 2021

    @isaacvonaaron

    Just want to upvote on this and say it's very important and affects users from most of the world except north America and part of western Europe. The rest of the world needs to switch between input methods quite often.

  6. koshelevdk commented on Apr 8, 2021

    @koshelevdk

    Same issue is relevant for Slack (messenger) and Atom (text editor). For slack we have web version at least. But other applications are completely useless.

  7. wlwl2 commented on Apr 9, 2021

    @wlwl2

    Just want to upvote on this and say it's very important and affects users from most of the world except north America and part of western Europe. The rest of the world needs to switch between input methods quite often.

    This Alt key ambiguity can affect all Alt- key shortcuts as well (I've had to remove my old shortcuts), and I'm working primarily in English right now. I've raised some points here:

    atom/atom#21825 (comment)

    One solution might be to separate Electron/Atom Alt key from the operating system Alt key. I'm also not sure at which point KeyDown, KeyUp and KeyPress is currently controlled. I wonder if that is done in Electron or Atom's codebase.

  8. MurzNN commented on May 17, 2021

    @MurzNN
    Author

    Still the very annoying issue on Electron 13.0 beta too, for all users, that user more than one keyboard layouts with default switch hotkey!

  9. PanosFirmpas commented on May 17, 2021

    @PanosFirmpas

    Commenting to add pressure for the issue to be fixed.

  10. self-assigned this
    on May 20, 2021
  11. vetash commented on May 24, 2021

    @vetash

    This is noncence, after all these years there is no any reaction for this bug! Just great. I decided to remove all menu in any electron based app on my desktop becaouse of this rubbish, thank you opensource, great job, Still not have any clue for how this can been happen AGAIN after some devs workaround this bug in 2017. element-hq/element-web@0cf16be

  12. MurzNN commented on Jun 28, 2021

    @MurzNN
    Author

    @zcbenz Can you please commend in which Electron release this PR is included? I testing app with Electron 13.0.1 (Chrome 91.0.4472.69) on KDE 5.22.0 (KDE Frameworks Version: 5.82.0) - the problem is still persist!
    But your PR integrated into VS Code (even for 12.x electron version) works well: microsoft/vscode#85405 (comment)

  13. MurzNN commented on Jun 28, 2021

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

Metadata

Metadata

Assignees

Labels

12-x-yhas-repro-repoplatform/linux

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions