aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordhewg2011-04-05 12:28:39 +0200
committerdhewg2011-04-05 12:44:46 +0200
commit9640048ad6e65c209251f68153dbc1560ee65676 (patch)
tree922f25785851aa78282ee5683dab2f5026985116
parentb4051db14273616b60744bee65e14668fbc62d28 (diff)
downloadscummvm-rg350-9640048ad6e65c209251f68153dbc1560ee65676.tar.gz
scummvm-rg350-9640048ad6e65c209251f68153dbc1560ee65676.tar.bz2
scummvm-rg350-9640048ad6e65c209251f68153dbc1560ee65676.zip
GUI: Update the screen after handling events
Fixes crash on droid: game -> gmm -> save -> click entry (EVENT_SCREEN_CHANGED due to vkeybd beeing shown) -> delete -> confirm another EVENT_SCREEN_CHANGED gets in simultaneously (due vkeybd being deactivated) and the parent dialog updated Rects out of bounds.
-rw-r--r--gui/gui-manager.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index 3ad4b2ee18..0cb06458ef 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -294,7 +294,6 @@ void GuiManager::runLoop() {
Common::Event event;
while (eventMan->pollEvent(event)) {
-
// The top dialog can change during the event loop. In that case, flush all the
// dialog-related events since they were probably generated while the old dialog
// was still visible, and therefore not intended for the new one.
@@ -306,12 +305,6 @@ void GuiManager::runLoop() {
Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);
- if (lastRedraw + waitTime < _system->getMillis()) {
- _theme->updateScreen();
- _system->updateScreen();
- lastRedraw = _system->getMillis();
- }
-
switch (event.type) {
case Common::EVENT_KEYDOWN:
activeDialog->handleKeyDown(event.kbd);
@@ -366,6 +359,12 @@ void GuiManager::runLoop() {
default:
break;
}
+
+ if (lastRedraw + waitTime < _system->getMillis()) {
+ _theme->updateScreen();
+ _system->updateScreen();
+ lastRedraw = _system->getMillis();
+ }
}
if (tooltipCheck && _lastMousePosition.time + kTooltipDelay < _system->getMillis()) {