diff options
-rw-r--r-- | backends/events/default/default-events.cpp | 9 | ||||
-rw-r--r-- | backends/events/default/default-events.h | 1 |
2 files changed, 9 insertions, 1 deletions
diff --git a/backends/events/default/default-events.cpp b/backends/events/default/default-events.cpp index 7c8c19c84e..d1e836ac59 100644 --- a/backends/events/default/default-events.cpp +++ b/backends/events/default/default-events.cpp @@ -94,7 +94,8 @@ DefaultEventManager::DefaultEventManager(OSystem *boss) : _buttonState(0), _modifierState(0), _shouldQuit(false), - _shouldRTL(false) { + _shouldRTL(false), + _confirmExitDialogActive(false) { assert(_boss); @@ -482,12 +483,18 @@ bool DefaultEventManager::pollEvent(Common::Event &event) { case Common::EVENT_QUIT: if (ConfMan.getBool("confirm_exit")) { + if (_confirmExitDialogActive) { + result = false; + break; + } + _confirmExitDialogActive = true; if (g_engine) g_engine->pauseEngine(true); GUI::MessageDialog alert("Do you really want to quit?", "Quit", "Cancel"); result = _shouldQuit = (alert.runModal() == GUI::kMessageOK); if (g_engine) g_engine->pauseEngine(false); + _confirmExitDialogActive = false; } else _shouldQuit = true; diff --git a/backends/events/default/default-events.h b/backends/events/default/default-events.h index e481accc3e..89846da1ae 100644 --- a/backends/events/default/default-events.h +++ b/backends/events/default/default-events.h @@ -52,6 +52,7 @@ class DefaultEventManager : public Common::EventManager { int _modifierState; bool _shouldQuit; bool _shouldRTL; + bool _confirmExitDialogActive; class RandomSourceRecord { public: |