all repos — mgba @ 0351d2e0ecb01e59e52d777c1e5596c0b1bc41ba

mGBA Game Boy Advance Emulator

Qt: Fix emulator crashing when full screen if a game is not running
Jeffrey Pfau jeffrey@endrift.com
Tue, 16 Dec 2014 22:12:22 -0800
commit

0351d2e0ecb01e59e52d777c1e5596c0b1bc41ba

parent

d0604c35af4e1540238fe4d7bfd71367163f5f4e

3 files changed, 11 insertions(+), 1 deletions(-)

jump to
M CHANGESCHANGES

@@ -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
M src/platform/qt/GameController.cppsrc/platform/qt/GameController.cpp

@@ -208,6 +208,9 @@ emit gameStopped(&m_threadContext);

} bool GameController::isPaused() { + if (!m_gameOpen) { + return false; + } return GBAThreadIsPaused(&m_threadContext); }
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -285,7 +285,7 @@ menuBar()->show();

} else { showFullScreen(); #ifndef Q_OS_MAC - if (!m_controller->isPaused()) { + if (m_controller->isLoaded() && !m_controller->isPaused()) { menuBar()->hide(); } #endif

@@ -302,6 +302,12 @@ GBAGetGameTitle(context->gba, title);

setWindowTitle(tr(PROJECT_NAME " - %1").arg(title)); attachWidget(m_display); m_screenWidget->setScaledContents(true); + +#ifndef Q_OS_MAC + if(isFullScreen()) { + menuBar()->hide(); + } +#endif m_fpsTimer.start(); }