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
Menu bar visibility toggling when it should't #35010
I'm running on a Linux environment using Gnome. I have the window.menuBarVisibility setting set to toggle which is triggered with the Alt key. Unfortunately, when I switch desktops using the default keyboard shortcut of Ctrl+Alt+[arrow], VSCode seems to think I've pressed Alt and it toggles the menu bar every time which is really annoying.
I tried changing the keyboard shortcut to Alt+M to toggle visibility but VSCode seems to still make it also toggle with Alt no matter what shortcut I set. The shortcut I configure just becomes an additional way to toggle it. I then tried setting the menu bar visibility to hidden hoping that would disable Alt so it would only toggle with my configured shortcut but once I press my configured toggle shortcut VSCode will go and change my setting from hidden back to toggle thus re-enabling the Alt shortcut to toggle.
There needs to be a way to either disable/change the Alt menu toggle shortcut or at the very least not trigger it when I switch desktops holding Ctrl+Alt+[arrow].
Reacted by Adam Byrd, Nathan Ridley, Davide Casella, Lyall Hamilton and no longer on github
I tried changing the keyboard shortcut to Alt+M to toggle visibility but VSCode seems to still make it also toggle with Alt no matter what shortcut I set.
Can you please open your keybindings.json file and check what keybindings are attached to the window.menuBarVisibility command?
This might be an Electron limitation. Sandeep Somavarapu (@sandy081) We don't do anything special on Alt on our side. i.e. we don't ship with any keybindings mapped to alt.
Sandeep Somavarapu (@sandy081) There is nothing set for that in my keybindings.json file. Apps commonly use Alt to toggle menu visibility. This might be built into Electron. The problem is that it also toggles visibility if I press Ctrl+Alt (regardless of whether I end up hitting an arrow key). Maybe there's a way to capture Ctrl+Alt explicitly and make it do nothing?
Just messed around with it more and it's really weird. Apparently if I press Ctrl+Alt in that order then it will toggle the menu bar. However, if I press Alt+Ctrl in that order then it doesn't toggle it.
This affects Windows as well. The core issue is that Alt toggles the menu when it is pressed as part of some other key combination in certain cases.
Scenario 1: hold Ctrl, press and release Alt
Result: Menu bar is toggled
Scenario 2: hold Alt, press and release Ctrl, release Alt
Result: Menu bar is not toggled
Ctrl can be replaced with any other key in both scenarios.
The expected behavior in both cases is that the menu bar is not toggled.
What I suspect is going on is that if another key is pressed while Alt is being held then releasing alt will not toggle the menu bar, but if another key is already held down while Alt is pressed and released then releasing Alt will toggle the menu bar. The specific change I'm supporting is that pressing and releasing Alt while another key is held should not cause the menu bar to be toggled.
I intended to open an issue for this as the inconsistency seems to be a bug. It's a constant annoyance in my daily work with VS Code. I use Ctrl+Alt+Left/Right to move focus between groups and if Alt bounces an extra time it toggles the menu bar. I also use different combinations of modifier keys and Left/Right for various editor group related actions so when I'm thinking about my next action I may press Ctrl+Alt then change my mind and release Alt. It happens too when I'm working quickly and I accidentally hit Alt a split second after theIt's an unwanted distraction to say the least.
So it sounds like this is a more fundamental issue with whatever is handling keyboard event bindings in general. If I have an event bound to Alt then my handler should only fire when that is the only key pressed. Whatever is in charge of firing keyboard event bindings right now must not be checking for exclusivity of the bound key combination before firing handlers.
Hold Ctrl, press and release Alt, notice the menu bar is toggled.
I've tested with various other applications on WIndows including Notepad, Paint, and Firefox. None of theme do this.
As I mentioned earlier in the thread, issue 1 is a daily annoyance for me, as it seems to happen very frequently when I jump between editor groups.
The new menu bar doesn't have these issues and it feels like the menu bars should be consistent with each other and with the rest of the Windows experience.
Adam Byrd (@akbyrd) same issue for me, I ended up setting the toggle to "hidden", which means it never toggles and I can't use it at all. However, ctrl+shift+P allows me to call up any command I really need, luckily
Activity
sandy081 commentedon Sep 26, 2017
Can you please open your keybindings.json file and check what keybindings are attached to the
window.menuBarVisibilitycommand?alexdima commentedon Sep 26, 2017
This might be an Electron limitation. Sandeep Somavarapu (@sandy081) We don't do anything special on
Alton our side. i.e. we don't ship with any keybindings mapped toalt.jwarkentin commentedon Sep 26, 2017
Sandeep Somavarapu (@sandy081) There is nothing set for that in my keybindings.json file. Apps commonly use
Altto toggle menu visibility. This might be built into Electron. The problem is that it also toggles visibility if I pressCtrl+Alt(regardless of whether I end up hitting an arrow key). Maybe there's a way to captureCtrl+Altexplicitly and make it do nothing?jwarkentin commentedon Sep 26, 2017
Just messed around with it more and it's really weird. Apparently if I press
Ctrl+Altin that order then it will toggle the menu bar. However, if I pressAlt+Ctrlin that order then it doesn't toggle it.akbyrd commentedon Oct 26, 2017
This affects Windows as well. The core issue is that Alt toggles the menu when it is pressed as part of some other key combination in certain cases.
Scenario 1: hold Ctrl, press and release Alt
Result: Menu bar is toggled
Scenario 2: hold Alt, press and release Ctrl, release Alt
Result: Menu bar is not toggled
Ctrl can be replaced with any other key in both scenarios.
The expected behavior in both cases is that the menu bar is not toggled.
What I suspect is going on is that if another key is pressed while Alt is being held then releasing alt will not toggle the menu bar, but if another key is already held down while Alt is pressed and released then releasing Alt will toggle the menu bar. The specific change I'm supporting is that pressing and releasing Alt while another key is held should not cause the menu bar to be toggled.
I intended to open an issue for this as the inconsistency seems to be a bug. It's a constant annoyance in my daily work with VS Code. I use Ctrl+Alt+Left/Right to move focus between groups and if Alt bounces an extra time it toggles the menu bar. I also use different combinations of modifier keys and Left/Right for various editor group related actions so when I'm thinking about my next action I may press Ctrl+Alt then change my mind and release Alt. It happens too when I'm working quickly and I accidentally hit Alt a split second after theIt's an unwanted distraction to say the least.
jwarkentin commentedon Oct 27, 2017
So it sounds like this is a more fundamental issue with whatever is handling keyboard event bindings in general. If I have an event bound to
Altthen my handler should only fire when that is the only key pressed. Whatever is in charge of firing keyboard event bindings right now must not be checking for exclusivity of the bound key combination before firing handlers.11 remaining items
bpasero commentedon Apr 3, 2018
Closing as the update to Electron 2.0.0-beta.6 landed via 88603b3. It should be in insider releases end of this week.
bpasero commentedon Apr 6, 2018
Reopening as we had to revert the update.
bpasero commentedon Aug 6, 2018
Closing, we pushed the Electron 2.0.x update for July release.
chrmarti commentedon Aug 6, 2018
Verified on Windows and Linux.
akbyrd commentedon Sep 8, 2018
Benjamin Pasero (@bpasero) There are still two issues with this:
Hold Ctrl, press and release Alt, notice the menu bar is toggled.
I've tested with various other applications on WIndows including Notepad, Paint, and Firefox. None of theme do this.
Press and release Alt, press escapse, notice the menu bar does not get hidden.
I tested with Firefox and Visual Studio 2015 (using https://marketplace.visualstudio.com/items?itemName=MatthewJohnsonMSFT.HideMainMenu) and both will hide the menu bar when escape is pressed.
As I mentioned earlier in the thread, issue 1 is a daily annoyance for me, as it seems to happen very frequently when I jump between editor groups.
The new menu bar doesn't have these issues and it feels like the menu bars should be consistent with each other and with the rest of the Windows experience.
pkieltyka commentedon Sep 8, 2018
Adam Byrd (@akbyrd) same issue for me, I ended up setting the toggle to "hidden", which means it never toggles and I can't use it at all. However, ctrl+shift+P allows me to call up any command I really need, luckily
akbyrd commentedon Sep 10, 2018
I've split the remaining bugs out into new issues.
#58376
#58377