Skip to content

Menu bar visibility toggling when it should't #35010

Closed

Description

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].

Activity

  1. sandy081 commented on Sep 26, 2017

    @sandy081
    Member

    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?

  2. added
    info-needed
    on Sep 26, 2017
  3. alexdima commented on Sep 26, 2017

    @alexdima
    Member

    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.

  4. added
    linux
    on Sep 26, 2017
  5. jwarkentin commented on Sep 26, 2017

    @jwarkentin
    Author

    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?

  6. jwarkentin commented on Sep 26, 2017

    @jwarkentin
    Author

    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.

  7. akbyrd commented on Oct 26, 2017

    @akbyrd
    Contributor

    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.

  8. jwarkentin commented on Oct 27, 2017

    @jwarkentin
    Author

    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.

  9. added
    bug
    on Nov 15, 2017
  10. 11 remaining items

  11. bpasero commented on Apr 3, 2018

    @bpasero
    Contributor

    Closing as the update to Electron 2.0.0-beta.6 landed via 88603b3. It should be in insider releases end of this week.

  12. bpasero commented on Apr 6, 2018

    @bpasero
    Contributor

    Reopening as we had to revert the update.

  13. removed this from the April 2018 milestone on Apr 6, 2018
  14. bpasero commented on Aug 6, 2018

    @bpasero
    Contributor

    Closing, we pushed the Electron 2.0.x update for July release.

  15. chrmarti commented on Aug 6, 2018

    @chrmarti
    Collaborator

    Verified on Windows and Linux.

  16. akbyrd commented on Sep 8, 2018

    @akbyrd
    Contributor

    Benjamin Pasero (@bpasero) There are still two issues with this:

    1. 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.

    2. 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.

  17. pkieltyka commented on Sep 8, 2018

    @pkieltyka

    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

  18. akbyrd commented on Sep 10, 2018

    @akbyrd
    Contributor

    I've split the remaining bugs out into new issues.

    #58376
    #58377

  19. locked and limited conversation to collaborators on Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions