aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorMax Horn2002-08-04 01:18:06 +0000
committerMax Horn2002-08-04 01:18:06 +0000
commit77daed66eae0e1526c1aee7558a2b08250f6bd78 (patch)
tree551f045c5c67cb38aa82a9a467adf5ede6a3d47a /gui
parent72efbd36b62ea8725c21470e81218696225c2c00 (diff)
downloadscummvm-rg350-77daed66eae0e1526c1aee7558a2b08250f6bd78.tar.gz
scummvm-rg350-77daed66eae0e1526c1aee7558a2b08250f6bd78.tar.bz2
scummvm-rg350-77daed66eae0e1526c1aee7558a2b08250f6bd78.zip
Fixed (worked around?) the nested dialog redraw bug; slightly changed the way mouseMoved events are handled in class Dialog
svn-id: r4694
Diffstat (limited to 'gui')
-rw-r--r--gui/dialog.cpp33
1 files changed, 19 insertions, 14 deletions
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index bee8037870..dea3d58b7b 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -32,10 +32,14 @@
/*
* TODO list
- * - if save or load fails (e.g. due to disk full/directory write protected),
+ * - If saving or loading fails (e.g. due to disk full/directory write protected),
* display an error dialog?
* - The user can edit the name of the autosave game. Of course this will not
* do anything, but we should still prevent this.
+ * - add some sense of the window being "active" (i.e. in front) or not. If it
+ * was inactive and just became active, reset certain vars (like who is focused).
+ * Maybe we should just add lostFocus and receivedFocus methods to Dialog, just
+ * like we have for class Widget?
* ...
*/
@@ -195,21 +199,22 @@ void Dialog::handleMouseMoved(int x, int y, int button)
_mouseWidget = 0;
w->handleMouseLeft(button);
}
-
- } else {
- w = findWidget(x, y);
- if (_mouseWidget != w) {
- if (_mouseWidget)
- _mouseWidget->handleMouseLeft(button);
- if (w)
- w->handleMouseEntered(button);
- _mouseWidget = w;
- }
+ w->handleMouseMoved(x - w->_x, y - w->_y, button);
+ }
- if (!w || !(w->getFlags() & WIDGET_TRACK_MOUSE)) {
- return;
- }
+ w = findWidget(x, y);
+
+ if (_mouseWidget != w) {
+ if (_mouseWidget)
+ _mouseWidget->handleMouseLeft(button);
+ if (w)
+ w->handleMouseEntered(button);
+ _mouseWidget = w;
+ }
+
+ if (!w || !(w->getFlags() & WIDGET_TRACK_MOUSE)) {
+ return;
}
w->handleMouseMoved(x - w->_x, y - w->_y, button);