diff options
-rw-r--r-- | dw/layout.cc | 24 | ||||
-rw-r--r-- | dw/layout.hh | 1 |
2 files changed, 11 insertions, 14 deletions
diff --git a/dw/layout.cc b/dw/layout.cc index bfaf9969..3680e0c8 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -185,7 +185,6 @@ Layout::Layout (Platform *platform) view = NULL; topLevel = NULL; widgetAtPoint = NULL; - deletingTopLevel = false; DBG_OBJ_CREATE (this, "DwRenderLayout"); @@ -226,10 +225,11 @@ Layout::~Layout () platform->removeIdle (resizeIdleId); if (bgColor) bgColor->unref (); - deletingTopLevel = true; - if (topLevel) - delete topLevel; - deletingTopLevel = false; + if (topLevel) { + Widget *w = topLevel; + topLevel = NULL; + delete w; + } delete platform; delete view; delete anchorsTable; @@ -282,10 +282,11 @@ void Layout::removeWidget () void Layout::setWidget (Widget *widget) { widgetAtPoint = NULL; - deletingTopLevel = true; - if (topLevel) - delete topLevel; - deletingTopLevel = false; + if (topLevel) { + Widget *w = topLevel; + topLevel = NULL; + delete w; + } textZone->zoneFree (); addWidget (widget); @@ -775,9 +776,6 @@ bool Layout::motionNotify (View *view, int x, int y, ButtonState state) { EventButton event; - if (deletingTopLevel) - return true; - moveToWidgetAtPoint (x, y, state); event.xCanvas = x; @@ -836,7 +834,7 @@ Widget *Layout::getWidgetAtPoint (int x, int y) { _MSG ("------------------------------------------------------------\n"); _MSG ("widget at (%d, %d)\n", x, y); - if (topLevel && !deletingTopLevel) + if (topLevel) return topLevel->getWidgetAtPoint (x, y, 0); else return NULL; diff --git a/dw/layout.hh b/dw/layout.hh index 495a8526..dc9bf227 100644 --- a/dw/layout.hh +++ b/dw/layout.hh @@ -132,7 +132,6 @@ 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; |