[Scummvm-cvs-logs] scummvm master -> 453eeb496c7cf2ef9b999c82b8211ced048c0eca

lordhoto lordhoto at gmail.com
Mon Jan 30 23:01:38 CET 2012


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
453eeb496c GUI: Work around bug #3481395.


Commit: 453eeb496c7cf2ef9b999c82b8211ced048c0eca
    https://github.com/scummvm/scummvm/commit/453eeb496c7cf2ef9b999c82b8211ced048c0eca
Author: Johannes Schickel (lordhoto at scummvm.org)
Date: 2012-01-30T14:00:16-08:00

Commit Message:
GUI: Work around bug #3481395.

The bug in question is: "LAUNCHER: Can't quit from unsupported game dialog".

Changed paths:
    gui/gui-manager.cpp



diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 64853b5..5b8c03c 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();






More information about the Scummvm-git-logs mailing list