diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index f7e45de32..0893b43bd 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -68,6 +68,7 @@ Window::Window(ConfigController* config, int playerId, QWidget* parent) , m_mruMenu(nullptr) , m_shortcutController(new ShortcutController(this)) , m_playerId(playerId) + , m_fullscreenOnStart(false) { setFocusPolicy(Qt::StrongFocus); setAcceptDrops(true); @@ -469,6 +470,10 @@ void Window::showEvent(QShowEvent* event) { rect.moveCenter(QApplication::desktop()->availableGeometry().center()); move(rect.topLeft()); } + if (m_fullscreenOnStart) { + enterFullScreen(); + m_fullscreenOnStart = false; + } } void Window::closeEvent(QCloseEvent* event) { @@ -518,6 +523,10 @@ void Window::mouseDoubleClickEvent(QMouseEvent* event) { } void Window::enterFullScreen() { + if (!isVisible()) { + m_fullscreenOnStart = true; + return; + } if (isFullScreen()) { return; } diff --git a/src/platform/qt/Window.h b/src/platform/qt/Window.h index ebc923776..eeff65df6 100644 --- a/src/platform/qt/Window.h +++ b/src/platform/qt/Window.h @@ -163,6 +163,7 @@ private: QMenu* m_mruMenu; ShortcutController* m_shortcutController; int m_playerId; + bool m_fullscreenOnStart; bool m_hitUnimplementedBiosCall;