Truly independent web browser
UI/Qt: Keep a maximized window maximized through page full screen
sideshowbarker4fb8c2f2a597
diff --git a/UI/Qt/BrowserWindow.cpp b/UI/Qt/BrowserWindow.cppindex 640f3d726de..c4adcc8b7c1 100644--- a/UI/Qt/BrowserWindow.cpp+++ b/UI/Qt/BrowserWindow.cpp@@ -1605,8 +1605,8 @@ void BrowserWindow::enter_fullscreen(){m_tabs_container->set_tab_bar_visible(false);- m_restore_to_maximized = isMaximized();- showFullScreen();+ // NB: Only the full-screen state changes, so the window comes back maximized if it was.+ setWindowState(windowState() | Qt::WindowFullScreen);m_tabs_container->update_bookmarks_bar_visibility();}@@ -1618,10 +1618,7 @@ void BrowserWindow::exit_fullscreen()m_tabs_container->set_tab_bar_visible(true);- if (m_restore_to_maximized)- showMaximized();- else- showNormal();+ setWindowState(windowState() & ~Qt::WindowFullScreen);m_tabs_container->update_bookmarks_bar_visibility();}diff --git a/UI/Qt/BrowserWindow.h b/UI/Qt/BrowserWindow.hindex bb38fd2dec2..fb6eea0cd7c 100644--- a/UI/Qt/BrowserWindow.h+++ b/UI/Qt/BrowserWindow.h@@ -361,7 +361,6 @@ private:ExitFullscreenButton* m_exit_button { nullptr };FullscreenMode* m_fullscreen_mode { nullptr };// Determine if window should restore to maximized or normal, when exiting fullscreen.- bool m_restore_to_maximized { false };bool m_resize_cursor_active { false };// The widget the last left button press in the window landed on, so a double click can tell whether its first// click landed on the same widget as its second.