[Scummvm-git-logs] scummvm master -> 5638fc84f364f6d3e01edcc8921561b8261299db
criezy
criezy at scummvm.org
Fri Dec 4 22:43:26 UTC 2020
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:
5638fc84f3 GUI: Prevent the 'Confirm RTL' dialog from being invoked recursively
Commit: 5638fc84f364f6d3e01edcc8921561b8261299db
https://github.com/scummvm/scummvm/commit/5638fc84f364f6d3e01edcc8921561b8261299db
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2020-12-04T22:43:03Z
Commit Message:
GUI: Prevent the 'Confirm RTL' dialog from being invoked recursively
I reused the same flag that was already used for the same purpose
for the 'Confirm exit' dialog. This means that if we have both a
RTL and a Quit event in the queue, only the first one will have a
confirmation dialog. If this is an issue, we can instead introduce
a separate flag for the RTL dialog.
Changed paths:
backends/events/default/default-events.cpp
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp
index 7c5fd5f61d..247f8bda62 100644
--- a/backends/events/default/default-events.cpp
+++ b/backends/events/default/default-events.cpp
@@ -171,11 +171,19 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
#endif
case Common::EVENT_RETURN_TO_LAUNCHER:
if (ConfMan.getBool("confirm_exit")) {
- PauseToken pt;
- if (g_engine)
- pt = g_engine->pauseEngine();
- GUI::MessageDialog alert(_("Do you really want to return to the Launcher?\nAny unsaved progress will be lost."), _("Yes"), _("Cancel"));
- forwardEvent = _shouldReturnToLauncher = (alert.runModal() == GUI::kMessageOK);
+ if (_confirmExitDialogActive) {
+ forwardEvent = false;
+ break;
+ }
+ _confirmExitDialogActive = true;
+ {
+ PauseToken pt;
+ if (g_engine)
+ pt = g_engine->pauseEngine();
+ GUI::MessageDialog alert(_("Do you really want to return to the Launcher?\nAny unsaved progress will be lost."), _("Yes"), _("Cancel"));
+ forwardEvent = _shouldReturnToLauncher = (alert.runModal() == GUI::kMessageOK);
+ }
+ _confirmExitDialogActive = false;
} else
_shouldReturnToLauncher = true;
break;
More information about the Scummvm-git-logs
mailing list