Repository navigation
Add option for hiding the menubar on Windows/Linux desktop - #13978
Merged
Merged
Conversation
timtmok
approved these changes
Nov 24, 2023
sharon-wang
approved these changes
Nov 24, 2023
gtritchie
marked this pull request as ready for review
December 1, 2023 16:49
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Addresses #8932 and #13973
Approach
Added a new checkbox option to autohide the menubar (at the bottom of Tools / Global Options / General).
When enabled, the menu is hidden by default but is revealed by tapping the Alt key or using a shortcut such as Alt+F for the File menu.
Also fixed a glitch where you could make the menubar appear on secondary windows if you tapped the Alt key (e.g. editors, git, help, zoomed plots, and so forth). The menu isn't intended to be on those windows and may do weird things.
This was tougher to fix than it sounds. All windows in an Electron app automatically inherit the main menu from the main window. We remove it when we create those windows, but anytime RStudio updates the main menu (e.g. if you open a file in the editor) the menus get recreated and put back on all windows. So we have to remove the menu again from all but the main window anytime the menu updates. Fun. This is done via a broadcast message anytime we set a new main menu.
Automated Tests
None
QA Notes
Autohiding the menu is specific to Desktop (Electron) for Windows and Linux. Confirm that when this option is enabled, the main menu is hidden until you tap the Alt key. Also checked that shortcuts work (e.g.Alt+Ffor File menu).
To check that menus don't appear on the secondary windows, click on the window and tap Alt and make sure no menu appears.
Be sure to test at least one instance of each class of windows (these have different code paths):
Diagnostic Windows
Used by the "Show GPU Diagnostics" and "Show Accessibility Diagnostics" commands. The issue is only partially fixed on these windows. If you bring up one of these and then go back to the main window and do something that triggers a rebuild of the main menu (e.g. open a file), the menu will reappear on these windows. I didn't think this was worth fixing given the nature of these windows.
Minimal Windows
Use the Zoom button on the plots pane or the viewer pane to see a "minimal window".
Secondary Windows
Use the "Show in new window" button in the Help Pane to see an instance of a Secondary Window.
Satellite Windows
These are used by "popped-out" editors and the Version Control window (possibly others, but testing these two will be sufficient).
Documentation
N/A
Checklist
NEWS.md