aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorEugene Sandulenko2016-11-12 12:09:14 +0100
committerGitHub2016-11-12 12:09:14 +0100
commitcd7bddf644d06c2fcc8d38773d3446bc273660e8 (patch)
tree4c5d9708482e64d79648a84c98969b3746681ce2 /gui
parent3c22643bae7ebf5dbdaddebdc58c2d5d4b12b01c (diff)
parentb1c678f509ce8bcdd599ec212dc9ddb71d0800b0 (diff)
downloadscummvm-rg350-cd7bddf644d06c2fcc8d38773d3446bc273660e8.tar.gz
scummvm-rg350-cd7bddf644d06c2fcc8d38773d3446bc273660e8.tar.bz2
scummvm-rg350-cd7bddf644d06c2fcc8d38773d3446bc273660e8.zip
Merge pull request #720 from ottogin/gui-events-fix
GUI: Fix "eaten" event by dialog which was closed
Diffstat (limited to 'gui')
-rw-r--r--gui/gui-manager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 9d68d76c9c..d28a0df8c2 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -326,10 +326,13 @@ void GuiManager::runLoop() {
//
// This hopefully fixes strange behavior/crashes with pop-up widgets. (Most easily
// triggered in 3x mode or when running ScummVM under Valgrind.)
- if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED)
- continue;
-
+ if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED) {
+ processEvent(event, getTopDialog());
+ continue;
+ }
+
processEvent(event, activeDialog);
+
if (lastRedraw + waitTime < _system->getMillis(true)) {
lastRedraw = _system->getMillis(true);
@@ -504,6 +507,8 @@ void GuiManager::screenChange() {
}
void GuiManager::processEvent(const Common::Event &event, Dialog *const activeDialog) {
+ if (activeDialog == 0)
+ return;
int button;
uint32 time;
Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);