Skip to content

Suggested menu toggle fix. Solves #41070 #35010 #37724 - #46181

Closed
Lyall Hamilton (lyallh) wants to merge 2 commits into
microsoft:masterfrom
lyallh:master
Closed

Lyall Hamilton (lyallh) wants to merge 2 commits into
microsoft:masterfrom
lyallh:master

Conversation

@lyallh

Copy link
Copy Markdown

This is a fix I described in this comment

If a user has explicity set a keybinding to toggleMenuBar then that should override the built-in Alt toggle, since that's obviously the user's intention by setting their own key. So toggleMenuBar should change behaviour and toggle between default and hidden

@bpasero

Copy link
Copy Markdown
Contributor

Lyall Hamilton (@lyallh) I am not a big fan of changing the semantics of this command in such a subtle way. How about introducing 2 new actions/commands "Show Menu" and "Hide Menu" that set the corresponding configuration value to hidden or visible and not toggle?

@bpasero Benjamin Pasero (bpasero) added the info-needed Issue requires more information from poster label Mar 20, 2018
@lyallh

Copy link
Copy Markdown
Author

No worries. I can see your point. Like you said, the issue is really an upstream limitation in electron (can't remap Alt-key for autoHideMenubar) so this is a workaround.

Separate show and hide commands is slightly less convenient but could also satisfy the complaints. But bear in mind it does not address the underlying incongruence/dichotomy in the current toggling implementation that will continue to cause confusion/minor frustration for anyone attempting to change the toggle menu bar key.

My alternate suggestion would be to make Toggle Menu Bar respect the user's visibility setting better. Toggling from the 'hidden' visibility state will toggle between 'hidden'/'default'. Toggling from 'toggle' will toggle between 'toggle'/'default' (default/current behaviour).

Have pushed a quickfix implementation of this as example.

@bpasero

Copy link
Copy Markdown
Contributor

Lyall Hamilton (@lyallh) yeah that sounds like a good approach too

@bpasero Benjamin Pasero (bpasero) added this to the March 2018 milestone Mar 21, 2018
@bpasero Benjamin Pasero (bpasero) removed the info-needed Issue requires more information from poster label Mar 21, 2018
@lyallh

Copy link
Copy Markdown
Author

Yeah semantically I'd expect a "toggle" to switch to some new state and then back to to the original. Not happening currently when Toggle Menu Bar goes hidden -> default -> toggle. I have to go back into settings to restore my 'hidden' setting.

@bpasero

Copy link
Copy Markdown
Contributor

Lyall Hamilton (@lyallh) I don't think your fix works, there is many more ways how this setting could have changed (e.g. by the user editing settings) and it would also not survive a restart.

@bpasero Benjamin Pasero (bpasero) removed this from the March 2018 milestone Mar 21, 2018
@lyallh

Lyall Hamilton (lyallh) commented Mar 21, 2018 •

Copy link
Copy Markdown
Author

Benjamin Pasero (@bpasero) Yeah it won't survive a restart if a user closes with the menubar visible.

But for the case we are talking about, in which a user has the menu normally on hidden and wants to occasionally toggle it visible with Toggle Menu Bar it works (as long as they close program with the menubar hidden - it will open on hidden and the hidden state will be captured on first toggle)

It's a quick fix and starting point while exploring how to solve this. I could attempt to implement a more robust/persistent solution some day but won't unless you approve of the approach.

Perhaps lets let this lie / close until someone comments on the issue again and wants a fix.

@jwarkentin

Copy link
Copy Markdown

The fundamental problem here is a conflation of temporary vs persistent state. It would make more sense to treat window.menuBarVisibility as a persistent default value that is independent of the actual menu bar visibility state. The one thing that makes absolutely no sense whatsoever is the current behavior of actually changing the user setting in response to toggling the temporary visibility state with the Alt key. At the very least, don't overwrite the user setting. Ideally though, treat the current temporary state value separate from the saved default state value.

@lyallh

Copy link
Copy Markdown
Author

Justin Warkentin (@jwarkentin) that's a good point. Think I agree it would be better if the toggle command operated on a temporary variable that is controlling the menubar visibility for the session. Rather than controlling visbility directly from the settings value. If someone wants to make a permanenet change to visibility they should have to go into settings. I could implement this is you agree Benjamin Pasero (@bpasero).

But maybe there are other things relying on the menuBarVisibility setting to reflect the actual state. Complicating things.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants