From c9a38dbc7084e9677cc417245deed1c2b3ecdeb0 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Tue, 16 Dec 2014 22:12:22 -0800 Subject: [PATCH] Qt: Fix emulator crashing when full screen if a game is not running Conflicts: CHANGES --- CHANGES | 1 + src/platform/qt/GameController.cpp | 3 +++ src/platform/qt/Window.cpp | 8 +++++++- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 86894513e..7fb019804 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,7 @@ 0.1.1: (Future) Bugfixes: - Qt: Fix issue with set frame sizes being the wrong height + - Qt: Fix emulator crashing when full screen if a game is not running Misc: - Qt: Disable sync to video by default diff --git a/src/platform/qt/GameController.cpp b/src/platform/qt/GameController.cpp index 678928090..05d07a9d4 100644 --- a/src/platform/qt/GameController.cpp +++ b/src/platform/qt/GameController.cpp @@ -208,6 +208,9 @@ void GameController::closeGame() { } bool GameController::isPaused() { + if (!m_gameOpen) { + return false; + } return GBAThreadIsPaused(&m_threadContext); } diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 7a56d3d0e..13b742fea 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -284,7 +284,7 @@ void Window::toggleFullScreen() { } else { showFullScreen(); #ifndef Q_OS_MAC - if (!m_controller->isPaused()) { + if (m_controller->isLoaded() && !m_controller->isPaused()) { menuBar()->hide(); } #endif @@ -302,6 +302,12 @@ void Window::gameStarted(GBAThread* context) { attachWidget(m_display); m_screenWidget->setScaledContents(true); +#ifndef Q_OS_MAC + if(isFullScreen()) { + menuBar()->hide(); + } +#endif + m_fpsTimer.start(); }