mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
fix: menu bar visibility when exiting full screen (#38681)
* fix:visibility of menu bar when exiting full screen Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * format code Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * format code Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * Modify comments Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * add menu bar visibility test Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * format code Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * change code Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * platform related in test Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> * Update api-browser-window-spec.ts * Update api-browser-window-spec.ts --------- Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: wugaosheng <wugaosheng@kylinos.cn> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
@@ -730,10 +730,14 @@ void NativeWindowViews::SetFullScreen(bool fullscreen) {
|
||||
gfx::Rect());
|
||||
|
||||
// Auto-hide menubar when in fullscreen.
|
||||
if (fullscreen)
|
||||
if (fullscreen) {
|
||||
menu_bar_visible_before_fullscreen_ = IsMenuBarVisible();
|
||||
SetMenuBarVisibility(false);
|
||||
else
|
||||
SetMenuBarVisibility(!IsMenuBarAutoHide());
|
||||
} else {
|
||||
SetMenuBarVisibility(!IsMenuBarAutoHide() &&
|
||||
menu_bar_visible_before_fullscreen_);
|
||||
menu_bar_visible_before_fullscreen_ = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -320,6 +320,9 @@ class NativeWindowViews : public NativeWindow,
|
||||
// Handles unhandled keyboard messages coming back from the renderer process.
|
||||
views::UnhandledKeyboardEventHandler keyboard_event_handler_;
|
||||
|
||||
// Whether the menubar is visible before the window enters fullscreen
|
||||
bool menu_bar_visible_before_fullscreen_ = false;
|
||||
|
||||
// Whether the window should be enabled based on user calls to SetEnabled()
|
||||
bool is_enabled_ = true;
|
||||
// How many modal children this window has;
|
||||
|
||||
Reference in New Issue
Block a user