From 532bebc888095dfabd46334e6f9ec4fafc828a49 Mon Sep 17 00:00:00 2001 From: Louis Moureaux Date: Sat, 9 Jul 2022 20:03:19 +0200 Subject: [PATCH] Remember the previous window state when leaving fullscreen Tested on Linux (KWin/X11) only. Closes #1094. --- client/menu.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/client/menu.cpp b/client/menu.cpp index a05bdc04dd..50404be2ef 100644 --- a/client/menu.cpp +++ b/client/menu.cpp @@ -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; } /**