diff options
-rw-r--r-- | dw/iterator.cc | 6 | ||||
-rw-r--r-- | dw/iterator.hh | 1 | ||||
-rw-r--r-- | dw/oofawarewidget.cc | 18 | ||||
-rw-r--r-- | dw/stackingcontextmgr.cc | 2 |
4 files changed, 26 insertions, 1 deletions
diff --git a/dw/iterator.cc b/dw/iterator.cc index 92a028d0..fccd4c1a 100644 --- a/dw/iterator.cc +++ b/dw/iterator.cc @@ -955,5 +955,11 @@ void StackingIteratorStack::backward () topPos--; } +void StackingIteratorStack::cleanup () +{ + while (!atRealTop ()) + vector->remove (vector->size () - 1); +} + } // namespace core } // namespace dw diff --git a/dw/iterator.hh b/dw/iterator.hh index 773cf303..acef26da 100644 --- a/dw/iterator.hh +++ b/dw/iterator.hh @@ -285,6 +285,7 @@ public: void pop (); void forward (); void backward (); + void cleanup (); }; } // namespace core diff --git a/dw/oofawarewidget.cc b/dw/oofawarewidget.cc index c31aa83a..2c7afd1f 100644 --- a/dw/oofawarewidget.cc +++ b/dw/oofawarewidget.cc @@ -532,6 +532,24 @@ Widget *OOFAwareWidget::getWidgetAtPoint (int x, int y, // Continue with the current state of "iterator". *interruptedWidget = NULL; DBG_OBJ_MSG ("events", 1, "done with interruption"); + + // The interrupted widget may have returned non-NULL. In this + // case, the stack must be cleaned up explicitly, which would + // otherwise be done implicitly during the further search. + // (Since drawing is never quit completely, this problem only + // applies to searching.) + if (widgetAtPoint) { + iteratorStack->cleanup (); + + DBG_IF_RTFL { + StringBuffer sb; + iteratorStack->intoStringBuffer (&sb); + DBG_OBJ_MSGF ("events", 2, + "iteratorStack after cleanup: %s", + sb.getChars ()); + } + } + } } else { OOFStackingIterator* osi = diff --git a/dw/stackingcontextmgr.cc b/dw/stackingcontextmgr.cc index 9f8747f9..cbdef129 100644 --- a/dw/stackingcontextmgr.cc +++ b/dw/stackingcontextmgr.cc @@ -172,7 +172,7 @@ Widget *StackingContextMgr::getWidgetAtPoint (int x, int y, int startZIndex, int endZIndex, int *index) { - DBG_OBJ_ENTER ("events", 0, "getWidgetAtPointBottom", "%d, %d", x, y); + DBG_OBJ_ENTER ("events", 0, "getWidgetAtPoint", "%d, %d", x, y); Widget *widgetAtPoint = NULL; |