From 0351d2e0ecb01e59e52d777c1e5596c0b1bc41ba 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 --- 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 d943fc038..abd5c3752 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,7 @@ Features: - Support for gamepad axes, e.g. analog sticks or triggers 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 0.1.0: (2014-12-13) - Initial release 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 215896e78..18a2e5674 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -285,7 +285,7 @@ void Window::toggleFullScreen() { } else { showFullScreen(); #ifndef Q_OS_MAC - if (!m_controller->isPaused()) { + if (m_controller->isLoaded() && !m_controller->isPaused()) { menuBar()->hide(); } #endif @@ -303,6 +303,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(); }