diff options
-rw-r--r-- | dw/layout.cc | 7 | ||||
-rw-r--r-- | dw/layout.hh | 1 |
2 files changed, 6 insertions, 2 deletions
diff --git a/dw/layout.cc b/dw/layout.cc index e33da4d1..c73b9760 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -185,6 +185,7 @@ Layout::Layout (Platform *platform) view = NULL; topLevel = NULL; widgetAtPoint = NULL; + deletingTopLevel = false; DBG_OBJ_CREATE (this, "DwRenderLayout"); @@ -278,9 +279,11 @@ void Layout::removeWidget () void Layout::setWidget (Widget *widget) { + widgetAtPoint = NULL; + deletingTopLevel = true; if (topLevel) delete topLevel; - widgetAtPoint = NULL; + deletingTopLevel = false; textZone->zoneFree (); addWidget (widget); @@ -828,7 +831,7 @@ Widget *Layout::getWidgetAtPoint (int x, int y) { _MSG ("------------------------------------------------------------\n"); _MSG ("widget at (%d, %d)\n", x, y); - if (topLevel) + if (topLevel && !deletingTopLevel) return topLevel->getWidgetAtPoint (x, y, 0); else return NULL; diff --git a/dw/layout.hh b/dw/layout.hh index dc9bf227..495a8526 100644 --- a/dw/layout.hh +++ b/dw/layout.hh @@ -132,6 +132,7 @@ private: Platform *platform; View *view; Widget *topLevel, *widgetAtPoint; + bool deletingTopLevel; // XXX quick hack for fltk-1.3 port /* The state, which must be projected into the view. */ style::Color *bgColor; |