Skip to content

Commit

Permalink
Remember the previous window state when leaving fullscreen
Browse files Browse the repository at this point in the history
Tested on Linux (KWin/X11) only.

Closes #1094.
  • Loading branch information
lmoureaux committed Jul 9, 2022
1 parent b08f3c7 commit 8d60b48
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2488,15 +2488,12 @@ void enable_interface(bool enable)
*/
void mr_menu::slot_fullscreen()
{
if (!gui_options.gui_qt_fullscreen) {
king()->showFullScreen();
queen()->game_tab_widget->showFullScreen();
gui_options.gui_qt_fullscreen = !gui_options.gui_qt_fullscreen;
if (gui_options.gui_qt_fullscreen) {
king()->setWindowState(king()->windowState() | Qt::WindowFullScreen);
} else {
// FIXME Doesnt return properly, probably something with sidebar
king()->showNormal();
queen()->game_tab_widget->showNormal();
king()->setWindowState(king()->windowState() & ~Qt::WindowFullScreen);
}
gui_options.gui_qt_fullscreen = !gui_options.gui_qt_fullscreen;
}

/**
Expand Down

0 comments on commit 8d60b48

Please sign in to comment.