You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[regression] Linux Electron after upgrade to 6.0+ always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys #22213
Operating system: All Linux distributions with KDE environment
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!
How to reproduce:
Add any second keyboard layout in KDE settings, default hotkey for switch will be "Alt+Shift".
Open any app, using Electron 6.0 version, for example "Quick start" app.
Make focus on any input element, start typing some text.
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.
How to fix:
Downgrade Electron application to 5.x or earlier versions of Electron, and this issue will not reproduced!
Please investigate source of this issue and fix this regression on fresh Electron versions!
P.S. 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.
Reacted by Vitaly Barakov, faustoFF, Alexey Murz Korepov, Roman Parkhunovskyi, Kipras Melnikovas, Steve Todorov, p-boiko, brnovk, Fathom, Alex Derbenev and 24 more
@AlexDerbenew - yes, this is regression on Electron 6.0 release and all newer versions, because all applications, using Electron 4.x-5.x, that fixes issue #11106 via "menu shortcuts" workaround, works well with "Alt+Shift" layout switch, but broken again after upgrade dependency to Electron 6.0. So, as result, Electron 6.0 do some new change, that broke normal behavior of Alt+Shift layout switch hotkey!
changed the title [-][regression] Linux Electron always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/-][+][regression] Linux Electron after upgrade to 6.0 always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/+]on Feb 17, 2020
changed the title [-][regression] Linux Electron after upgrade to 6.0 always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/-][+][regression] Linux Electron after upgrade to 6.0+ always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/+]on Feb 20, 2020
This is really annoying issue. I am having it as well as many other people and it makes apps pretty much unusable when you have multi-language environment. It's also affecting Skype, RocketChat/Rocket.Chat.Electron#1355 and other apps which rely on newer versions of Electron.
Really annoying issue. Noticed it on Slack and VSCode (on Fedora 31 with KDE).
Trying to avoid it by using Meta+Space to switch language, but changing a 25+ year old habit is hard! (Also, that's not a solution, it's a workaround)...
Reacted by Alex Derbenev, Alexander Strizhak, Centimo, trurle and ihorch
Please do not interact with the project for 24 hours. After that, please look through your open issues and edit them to ensure they're entirely on-topic, and we can continue the discussion here about the best way to go forward.
Being curious, looked at the places @MurzNN pointed out.
While reading, I found this comment somewhat strange, because afaik the menu bar should be toggled when any key is pressed with alt modifier except those which points to a submenu.
@MurzNN ok, I don't have skills in electron, but comment pointed only for alt + modifier command, but in my case it appears even I do Ctrl + modifier. (Even system meta key set to Meta aka Super versus system default Alt, see screenshot). Of course maybe I missed something important and system meta key not affect it at all to bug. But what can I say for sure that Ctrl + modifier or other as KB layout affect this issue.
UPD: It strange but I cannot reproduce it (even alt) on latest vscode (vscode: 1.47.1 Electron: 7.3.2) seems they made some fixes for that after 1.47.0 version. But I can build some pure electron app for testing, just give me some code and instruction how to build it. Will be glad to make some tests on my machine.
@sofianguy Hello, we will be glad if you find a couple of minutes to answer two questions:
Please, provide @mrkeuz some instruction for building a small test app (just a set of links to start with should be enough I think)
Please, we need a person from Electron team to help with resolvong this issue asap. Could you be that person? If not, could you point out some other contributor / member to communicate with? It won't consume much time as we will try to do everithing on our own here.
Cheers... and thank you for your help.
Have a nice day!
@mrkeuz this still happens to me in vscode version 1.48
I would like to clarify the steps to reproduce. pressing alt then shift then releasing alt first will cause the issue, the issue does not occur when releasing shift first.
If you're don't need window menu at all you can remove it completely.
0 close slack app
1 Install python jsbeautifier over pip3, npm, npx sudo apt install python3-pip sudo pip3 install jsbeautifier sudo apt install npm sudo npm install npx -g
2 Go to /usr/lib/slack
cd /usr/lib/slack
3 backup original archive sudo cp resources/app.asar resources/app.asar.back
4 unpack resource pack sudo npx asar extract resources/app.asar unpacked_asar
5 Make backup of main.bundle.js, make it readable with js-beautify then open with kate(or another text editor) and comment (or remove) code in function buildMenu(changedKeys) { sudo cp unpacked_asar/dist/main.bundle.js unpacked_asar/dist/main.bundle.js.back sudo js-beautify unpacked_asar/dist/main.bundle.js > /tmp/main.js sudo mv /tmp/main.js unpacked_asar/dist/main.bundle.js kate unpacked_asar/dist/main.bundle.js find buildMenu(changedKeys) { and remove\comment all between brackets {}
6 pack resource pack back sudo npx asar pack unpacked_asar/ resources/app.asar
Run slack again.
Reacted by victor-rt, Pavel, vch-lm and Aleksandr Smirnov
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.
Activity
hotsezus commentedon Feb 16, 2020
Is this a regression?
MurzNN commentedon Feb 16, 2020
@AlexDerbenew - yes, this is regression on Electron 6.0 release and all newer versions, because all applications, using Electron 4.x-5.x, that fixes issue #11106 via "menu shortcuts" workaround, works well with "Alt+Shift" layout switch, but broken again after upgrade dependency to Electron 6.0. So, as result, Electron 6.0 do some new change, that broke normal behavior of Alt+Shift layout switch hotkey!
[-][regression] Linux Electron always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/-][+][regression] Linux Electron after upgrade to 6.0 always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/+][-][regression] Linux Electron after upgrade to 6.0 always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/-][+][regression] Linux Electron after upgrade to 6.0+ always unnecessary opens BrowserWindow menu on every keyboard layout switch via Alt+Shift & Alt+Ctrl hotkeys[/+]steve-todorov commentedon Feb 20, 2020
This is really annoying issue. I am having it as well as many other people and it makes apps pretty much unusable when you have multi-language environment. It's also affecting Skype, RocketChat/Rocket.Chat.Electron#1355 and other apps which rely on newer versions of Electron.
hotsezus commentedon Feb 20, 2020
This also happens with all apps made by nativefier (using electron inside)
manussos commentedon Mar 31, 2020
Really annoying issue. Noticed it on Slack and VSCode (on Fedora 31 with KDE).
Trying to avoid it by using Meta+Space to switch language, but changing a 25+ year old habit is hard! (Also, that's not a solution, it's a workaround)...
chameleon-lizard commentedon Apr 22, 2020
The focus is also stolen if you are using Alt+Space shortcut to switch language. Fix, please!
jkleinsc commentedon Apr 27, 2020
@vetash your comment was deleted as a violation of the Electron Code of Conduct. You may consider this an official warning.
Please do not interact with the project for 24 hours. After that, please look through your open issues and edit them to ensure they're entirely on-topic, and we can continue the discussion here about the best way to go forward.
Dreyk007 commentedon May 8, 2020
Very annoying. Issue actual for every electron app (VSCode, Zulip, etc...)
KDE Neon (Ubuntu 18.04)
faerics commentedon Jun 21, 2020
Also influences two projects I often use:
Quite annoying. From now, when I think of using a new app, I check if it is based on Electron or not.
And if it is, I shall not use it.
Please, fix it!
2 remaining items
faerics commentedon Jul 11, 2020
Being curious, looked at the places @MurzNN pointed out.
While reading, I found this comment somewhat strange, because afaik the menu bar should be toggled when any key is pressed with alt modifier except those which points to a submenu.
Looking for someone to help us here! 🙏
MurzNN commentedon Jul 13, 2020
@faerics thanks for pointing to right place! At first look all rules are right, but when we pressing
Shiftafter holdingAlt- code seems think that this is modifier, and catch it via thisifhttps://github.com/electron/electron/blob/master/shell/browser/ui/views/root_view.cc#L122Maybe commenting this https://github.com/electron/electron/blob/master/shell/browser/ui/views/root_view.cc#L134 line can solve this issue?
Can anybody, who can compile Electron with test app from scratch, test this?
mrkeuz commentedon Jul 20, 2020
@MurzNN ok, I don't have skills in electron, but comment pointed only for
alt+ modifier command, but in my case it appears even I doCtrl+ modifier. (Even system meta key set toMetaakaSuperversus system defaultAlt, see screenshot). Of course maybe I missed something important and system meta key not affect it at all to bug. But what can I say for sure thatCtrl+ modifier or other as KB layout affect this issue.UPD: It strange but I cannot reproduce it (even
alt) on latest vscode (vscode: 1.47.1 Electron: 7.3.2) seems they made some fixes for that after 1.47.0 version. But I can build some pure electron app for testing, just give me some code and instruction how to build it. Will be glad to make some tests on my machine.faerics commentedon Jul 21, 2020
@sofianguy Hello, we will be glad if you find a couple of minutes to answer two questions:
Cheers... and thank you for your help.
Have a nice day!
DanielLitvak commentedon Aug 18, 2020
@mrkeuz this still happens to me in vscode version 1.48
I would like to clarify the steps to reproduce. pressing alt then shift then releasing alt first will cause the issue, the issue does not occur when releasing shift first.
NemchinovSergey commentedon Aug 27, 2020
The issue reproduces in Zulip v5.4.2 and Postman v7.30.1
My workaround for Zulip
on Linux:
cd /opt/Zulip/resourcescp app.asar app.asar.baknpx asar extract app.asar app-unpackednano ./app-unpacked/app/main/menu.jslabel: t.__('File')tolabel: t.__('&File')label: t.__('Edit')tolabel: t.__('&Edit')mv app.asar app_old.asarnpx asar pack app-unpacked app.asarOn Windows
You can use the 7zip archiver with the asap plugin
DanielLitvak commentedon Aug 27, 2020
@NemchinovSergey This probably won't work for versions 6+ of electron
timabbott commentedon Aug 27, 2020
Zulip desktop v5.4.2 is based on Electron 9.
NemchinovSergey commentedon Aug 28, 2020
@DanielLitvak @timabbott
Probably you are right but I fixed it with these actions and I hope it will help someone else.
vetash commentedon Sep 30, 2020
If you're don't need window menu at all you can remove it completely.
0 close slack app
1 Install python jsbeautifier over pip3, npm, npx
sudo apt install python3-pipsudo pip3 install jsbeautifiersudo apt install npmsudo npm install npx -g2 Go to
/usr/lib/slackcd
/usr/lib/slack3 backup original archive
sudo cp resources/app.asar resources/app.asar.back4 unpack resource pack
sudo npx asar extract resources/app.asar unpacked_asar5 Make backup of
main.bundle.js, make it readable with js-beautify then open with kate(or another text editor) and comment (or remove) code in functionbuildMenu(changedKeys) {sudo cp unpacked_asar/dist/main.bundle.js unpacked_asar/dist/main.bundle.js.backsudo js-beautify unpacked_asar/dist/main.bundle.js > /tmp/main.jssudo mv /tmp/main.js unpacked_asar/dist/main.bundle.jskate unpacked_asar/dist/main.bundle.jsfindbuildMenu(changedKeys) {and remove\comment all between brackets{}6 pack resource pack back
sudo npx asar pack unpacked_asar/ resources/app.asarRun slack again.
electron-triage commentedon Mar 10, 2021
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!
MurzNN commentedon Mar 10, 2021
Okay, if this is closed without any reasons 😠 , let's fill the new fresh one: #28088 🚀
ihorch commentedon May 24, 2021
I'm reproducing this right now with Debian Testing (slack-desktop 4.16 on Gnome 3.38).
nohhhon commentedon May 24, 2021