aboutsummaryrefslogtreecommitdiff
path: root/dw/layout.cc
diff options
context:
space:
mode:
authorJorge Arellano Cid <jcid@dillo.org>2011-08-09 12:27:07 -0400
committerJorge Arellano Cid <jcid@dillo.org>2011-08-09 12:27:07 -0400
commit422c01e42e09209d26b0baa1820a8b36bbdccbd6 (patch)
tree9a328e36d477ee5b2e56ade32a8e95cbb22521d0 /dw/layout.cc
parent52fcd4603e3a7b5c35e061538b27b0087c169f8b (diff)
crossing-events part4 (fix corner case: moving into the common ancestor)
In this case the ancestor is already in "entered" state, but we need to emit the signal again, for it to reset its state and resume.
Diffstat (limited to 'dw/layout.cc')
-rw-r--r--dw/layout.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/dw/layout.cc b/dw/layout.cc
index 1c8c44b7..9dfd5e9b 100644
--- a/dw/layout.cc
+++ b/dw/layout.cc
@@ -918,10 +918,13 @@ void Layout::moveToWidget (Widget *newWidgetAtPoint, ButtonState state)
if (i < i_a) {
track[i]->leaveNotify (&crossingEvent);
} else if (i == i_a) { /* ancestor */
- /* don't touch ancestor unless moving into/from NULL */
+ /* Don't touch ancestor unless:
+ * - moving into/from NULL,
+ * - ancestor becomes the newWidgetAtPoint */
if (i_a == trackLen-1 && !newWidgetAtPoint)
track[i]->leaveNotify (&crossingEvent);
- else if (i_a == 0 && !widgetAtPoint)
+ else if ((i_a == 0 && !widgetAtPoint) ||
+ (i_a == trackLen-1 && newWidgetAtPoint))
track[i]->enterNotify (&crossingEvent);
} else {
track[i]->enterNotify (&crossingEvent);