aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorottogin2016-03-24 16:55:17 +0300
committerottogin2016-03-24 21:31:53 +0300
commitb1c678f509ce8bcdd599ec212dc9ddb71d0800b0 (patch)
tree0135d4bca5be8997a61c3819cdd88a25dc5340a3
parent5b528a55827d3d5a95ac14d50063b24e14e1fdc0 (diff)
downloadscummvm-rg350-b1c678f509ce8bcdd599ec212dc9ddb71d0800b0.tar.gz
scummvm-rg350-b1c678f509ce8bcdd599ec212dc9ddb71d0800b0.tar.bz2
scummvm-rg350-b1c678f509ce8bcdd599ec212dc9ddb71d0800b0.zip
GUI: Fix "eaten" event by dialog which was closed
This patch fix bug #6841 If this runloop catches both the repeated key down event and the key up event. In this case they key down will close the tooltip, because it got closed the key up event will be ignored. As a result the LauncherDialog will never get notified the SHIFT state might have changed and not adapt the button description. In this patch we just pass event to topDialog, if activeDialog was closed. Also we must check, If topDialog doesn't exist.
-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 20c6d3fa13..ef37990dfc 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -331,10 +331,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 (event.type == Common::EVENT_MOUSEMOVE) {
tooltipCheck = true;
@@ -512,6 +515,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);