diff options
author | Johannes Schickel | 2012-01-30 22:59:09 +0100 |
---|---|---|
committer | Johannes Schickel | 2012-01-30 23:00:16 +0100 |
commit | 453eeb496c7cf2ef9b999c82b8211ced048c0eca (patch) | |
tree | 6b330bb75a22f7af8e3a8e8d2bccfb1fa5da8731 | |
parent | cf8a6dcd835d3db85648c07e3f254505ea7a7945 (diff) | |
download | scummvm-rg350-453eeb496c7cf2ef9b999c82b8211ced048c0eca.tar.gz scummvm-rg350-453eeb496c7cf2ef9b999c82b8211ced048c0eca.tar.bz2 scummvm-rg350-453eeb496c7cf2ef9b999c82b8211ced048c0eca.zip |
GUI: Work around bug #3481395.
The bug in question is: "LAUNCHER: Can't quit from unsupported game dialog".
-rw-r--r-- | gui/gui-manager.cpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index 64853b5096..5b8c03c672 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -279,7 +279,7 @@ void GuiManager::runLoop() { bool tooltipCheck = false; - while (!_dialogStack.empty() && activeDialog == getTopDialog()) { + while (!_dialogStack.empty() && activeDialog == getTopDialog() && !eventMan->shouldQuit()) { redraw(); // Don't "tickle" the dialog until the theme has had a chance @@ -358,8 +358,6 @@ void GuiManager::runLoop() { case Common::EVENT_WHEELDOWN: activeDialog->handleMouseWheel(mouse.x, mouse.y, 1); break; - case Common::EVENT_QUIT: - return; case Common::EVENT_SCREEN_CHANGED: screenChange(); break; @@ -388,6 +386,17 @@ void GuiManager::runLoop() { _system->delayMillis(10); } + // WORKAROUND: When quitting we might not properly close the dialogs on + // the dialog stack, thus we do this here to avoid any problems. + // This is most noticable in bug #3481395 "LAUNCHER: Can't quit from unsupported game dialog". + // It seems that Dialog::runModal never removes the dialog from the dialog + // stack, thus if the dialog does not call Dialog::close to close itself + // it will never be removed. Since we can have multiple run loops being + // called we cannot rely on catching EVENT_QUIT in the event loop above, + // since it would only catch it for the top run loop. + if (eventMan->shouldQuit() && activeDialog == getTopDialog()) + getTopDialog()->close(); + if (didSaveState) { _theme->disable(); restoreState(); |