diff options
author | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-01-21 23:48:30 +0100 |
---|---|---|
committer | Johannes Hofmann <Johannes.Hofmann@gmx.de> | 2011-01-21 23:48:30 +0100 |
commit | cb3b8d6caa623ba07b17d267957fc77fd997bbcd (patch) | |
tree | c75fabd34d74410f56dd948a00ee5c3442e96c3c | |
parent | 1795e959f35cc916e5f9be0848b149be0f917f88 (diff) |
quick fix for Layout::getWidgetAtPoint() crash in fltk-1.3
fltk-1.3 calls fl_fix_focus() on widget deletion, which causes dillo to
traverse it's own widget tree while it's getting deleted.
Stop this using a flag for now. It would be nice if we could fix this
more elegantly.
-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; |