Skip to content

Kubuntu 17.10 switching keyboard layout opens BrowserWindow menu #11106

Closed

Description

@Thomas101
  • Electron version: 1.7.9, 1.8.2-beta.2, 2.0.14, 3.0.14, 3.1.0, 4.0.1
  • Operating system: Kubuntu 17.10, Kubuntu 18.04

Expected behavior

When a global keyboard is setup to change keyboard layout using Alt+Ctrl or Alt+Shift should just change keyboard layout and have no effect on any focused electron windows.

Actual behavior

Keyboard layout is changed correctly, but if an electron browser window is focused the menu appears. If the menu has not been enabled on the BrowserWindow, but the application menu has been set the menu bar is shown and menu opened

How to reproduce

Electron Quick start will reproduce with an application menu set, as per the example in the docs.

Configure a global keyboard shortcut to switch keyboard layouts

  • Open System Settings
  • Go to Input Devices
  • Select Keyboard and then the Layouts tab
  • Change the Main Shortcut
    1
  • Pick Alt+Ctrl or Alt+Shift as a shortcut
    2

Now you're configured, press Alt+Ctrl (note that it must be in that order, not ctrl then alt) it will change the keyboard layout and also present the menu in the focused window.

Activity

  1. felixrieseberg commented on Nov 14, 2017

    @felixrieseberg
    Member

    Forgive my ignorance, but wouldn't it be on Kubuntu to capture the keyboard event and to not propagate it? It seems impossible for Electron to detect if the operating system (or other apps) have any handlers registered.

  2. Thomas101 commented on Nov 15, 2017

    @Thomas101
    ContributorAuthor

    I'm not 100% sure what's going on under the hood here and normally my bias would be towards it needing to be fixed in Kubuntu; hoever I tried running the same test with a few other apps, namely, Firefox and Dolphin, but didn't see the same behaviour. That's what made me suspicious that it's something that electron is doing.

    The only other app I managed to see the same behaviour with alongside my test apps was Slack - which is on electron too.

    @felixrieseberg What's the best way forward that you recommend here? Report to Kubuntu and see if they have any insight or do you think it's worth investigating if there's anything in electron?

  3. mtb-xt commented on Nov 21, 2017

    @mtb-xt

    The same issue happens under Cinnamon desktop in Archlinux, applications have to work around this in some obscure ways - RocketChat/Rocket.Chat.Electron#50.
    ALL electron based apps are affected, and this is very annoying.

    Slack, Messenger for Desktop just to name a few. I use alt shift to change keyboard layouts and every time I need to insert a russian word in a chat, it opens this damned menu.

    Please fix

  4. mpeshev commented on Nov 23, 2017

    @mpeshev

    I can confirm the same issue with Fedora running Mate.

    I ran some tests referenced in a Russian forum where different suggestions editing the Window or Edit labels were referenced.

    I've played with adding an accelerator element to buildEditMenu() for Edit but that crashed Slack and I couldn't progress further.

    It's been happening for weeks and I can't reproduce it in any other web or desktop application that I use daily.

    On Slack, a couple of important keyboard shortcuts use "Alt + Shift" as well and those are inactive for me at the moment.

  5. gedia commented on Dec 14, 2017

    @gedia

    Same on gentoo with slack 2.8.2. Several of the previous versions were affected too. This wasn't present several releases ago...

  6. vetash commented on Dec 14, 2017

    @vetash

    @gedia switch to 2.6.0. This is latest release that not have this behaviour.

  7. msva commented on Dec 21, 2017

    @msva

    @vetash wasn't it 2.6.3? // and there is no 2.6.0 in portage anyways.

    P.S. looks like issue still appears in 3.0.2, although slack's support sweared (38 days ago) me to fix this in "next version"

  8. vetash commented on Dec 23, 2017

    @vetash

    @msva No. Exact 2.6.0. You can mannualy download any release from slack.com by changed url
    https://downloads.slack-edge.com/linux_releases/slack-desktop-2.6.0-amd64.deb

  9. removed
    blocked/need-info ❌
    on Jan 17, 2018
  10. gedia commented on Jan 19, 2018

    @gedia

    Still affecting slack 3.0.5, released this week...

  11. 31 remaining items

  12. MurzNN commented on Feb 16, 2020

    @MurzNN

    Current issue is for too old Electron (2.0+) and have workaround via adding keyboard shortcuts to all menu items (example of fixing - here element-hq/element-web#4345 (comment)), that solve reported problem on related versions in most of popular Electron apps.

    But Electron 6.0 release introduce new issue, that can't solved via proposed workaround, and need separate investigate for find right fix. So I fill new separate issue for Electron 6.0 version here: #22213 - please vote!

  13. Dreyk007 commented on May 8, 2020

    @Dreyk007

    Very annoying. Issue actual for every electron app (VSCode, Zulip, etc...)
    KDE Neon (Ubuntu 18.04)

  14. protist commented on May 31, 2020

    @protist

    This bug is still present in Electron 9.0.0.

  15. vetash commented on Jun 15, 2020

    @vetash

    My job is consist of endles suffering because of this. Even if you having a habit press esc or worse ALT ANY TIME YOU WANT TO SWITCH LAYOUT this behaviour apppears. You just cant switch to NORMAL app, so you continue press this ALT key in every application you work so this make app open context menu. This not just annoying bug this destroy all of my and i'm sure not only my productivity.

  16. oukooveu commented on Jun 24, 2020

    @oukooveu

    Most probably this issue related to electron indirectly and actual root cause is https://gitlab.freedesktop.org/xorg/xserver/-/issues/258 (opened 15 years ago).

  17. MurzNN commented on Jun 24, 2020

    @MurzNN

    Most probably this issue related to electron indirectly and actual root cause is https://gitlab.freedesktop.org/xorg/xserver/-/issues/258 (opened 15 years ago).

    But why keyboards switching laoyuts works well in old Electron 5.0 apps (with fresh xorg), and breaks if they upgrade to Electron 6.0 and later versions?

  18. oukooveu commented on Jun 24, 2020

    @oukooveu

    But why keyboards switching laoyuts works well in old Electron 5.0 apps (with fresh xorg), and breaks if they upgrade to Electron 6.0 and later versions?

    I suggest there was some workaround in previous electron version (upgrade from linux mint 18.3 to 19.3 broke my slack for example), anyway xorg-server patch from issue above works for me (but in manjaro linux, not sure about ubuntu based distributions).

  19. DanielLitvak commented on Aug 18, 2020

    @DanielLitvak

    @oukooveu looks like this wont work for me because I am running Debian 10 using Gnome 3.30.2 and i have to use Xorg because Wayland does not work with Nvidia.

    I think we can agree that this issue should be solved in electron.

  20. protist commented on Aug 18, 2020

    @protist

    @oukooveu This also won't work for me, because I'm affected by the Electron bug and not the Xorg bug. I use At-home-modifier with my ergonomic keyboard to use Enter as Alt when held down. Hence, before sending Enter, my system presses and releases Alt first, which triggers the electron menu, removing focus, and not sending Enter to the right place. Super frustrating!

    So I agree; this issue can only be solved in Electron for me too.

  21. vavadik commented on Sep 8, 2020

    @vavadik

    A little trick for those who struggle with VS Code: set window.titleBarStyle option to 'custom' and the issue is gone.

  22. Sarbinski commented on Sep 8, 2020

    @Sarbinski

    A little trick for those who struggle with VS Code: set window.titleBarStyle option to 'custom' and the issue is gone.

    Thank you for this, now somebody to give a solution for Slack 💯

    P.S. The issue is still persist on the Kubuntu 20.04

  23. electron-triage commented on Mar 10, 2021

    @electron-triage

    The Electron version reported on this issue is no longer supported. See our supported versions documentation.

    If you're still experiencing this issue on a supported version, please open a new issue with an updated repro - a Fiddle is very appreciated.

    Electron has a large issues backlog. To help our team prioritize, we're closing older issues and asking for new issues with updated repro steps if it affects a supported version. This helps sort what issues are still relevant and helps us fix them more quickly.

    Thanks for your patience and understanding!

  24. protist commented on Mar 11, 2021

    @protist

    The similar issue #22213 was also closed by the bot. The new issue is #28088.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions