aboutsummaryrefslogtreecommitdiff
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
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.
-rw-r--r--dw/layout.cc7
-rw-r--r--dw/textblock.cc2
2 files changed, 6 insertions, 3 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);
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 3a2bf49c..312cb238 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -572,7 +572,7 @@ bool Textblock::motionNotifyImpl (core::EventMotion *event)
} else if (hoverTooltip)
hoverTooltip->onMotion ();
- _MSG("tb=%p word=%p linkOld=%d hoverLink=%d\n",
+ _MSG("MN tb=%p word=%p linkOld=%d hoverLink=%d\n",
this, word, linkOld, hoverLink);
if (hoverLink != linkOld) {
/* LinkEnter with hoverLink == -1 is the same as LinkLeave */