diff options
author | Sebastian Geerken <devnull@localhost> | 2014-06-12 11:07:21 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-06-12 11:07:21 +0200 |
commit | b068e76b797c92c92b9f363dd7cb1967fdff5b5b (patch) | |
tree | 3ee403025fbac1d92c7dc236c2085ce5f10a1ad1 | |
parent | 20697624f615da7e4aca96f9777a82d2cacb7cfb (diff) | |
parent | 24f92f1a625dfd9631b5350a56e75205083350df (diff) |
Merge with main repository.
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | dw/layout.cc | 2 | ||||
-rw-r--r-- | dw/outofflowmgr.cc | 19 | ||||
-rw-r--r-- | dw/textblock.cc | 10 | ||||
-rw-r--r-- | dw/widget.cc | 8 | ||||
-rw-r--r-- | src/dicache.c | 15 |
6 files changed, 35 insertions, 28 deletions
diff --git a/configure.ac b/configure.ac index f6f9d5c3..a0f582b3 100644 --- a/configure.ac +++ b/configure.ac @@ -120,12 +120,13 @@ dnl ------------------------- dnl dnl For debugging and to be user friendly AC_MSG_CHECKING([FLTK 1.3]) -fltk_version="`fltk-config --version 2>/dev/null`" +AC_PATH_PROG(FLTK_CONFIG,fltk-config) +fltk_version="`$FLTK_CONFIG --version 2>/dev/null`" case $fltk_version in 1.3.*) AC_MSG_RESULT(yes) - LIBFLTK_CXXFLAGS=`fltk-config --cxxflags` - LIBFLTK_CFLAGS=`fltk-config --cflags` - LIBFLTK_LIBS=`fltk-config --ldflags`;; + LIBFLTK_CXXFLAGS=`$FLTK_CONFIG --cxxflags` + LIBFLTK_CFLAGS=`$FLTK_CONFIG --cflags` + LIBFLTK_LIBS=`$FLTK_CONFIG --ldflags`;; ?*) AC_MSG_RESULT(no) AC_MSG_ERROR(FLTK 1.3 required; version found: $fltk_version);; *) AC_MSG_RESULT(no) diff --git a/dw/layout.cc b/dw/layout.cc index b9c6ff98..818effd2 100644 --- a/dw/layout.cc +++ b/dw/layout.cc @@ -1093,7 +1093,7 @@ Widget *Layout::getWidgetAtPoint (int x, int y) { _MSG ("------------------------------------------------------------\n"); _MSG ("widget at (%d, %d)\n", x, y); - if (topLevel) + if (topLevel && topLevel->wasAllocated ()) return topLevel->getWidgetAtPoint (x, y, 0); else return NULL; diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index a45c4785..1e80cec3 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -1366,10 +1366,12 @@ Widget *OutOfFlowMgr::getFloatWidgetAtPoint (SortedFloatsVector *list, for (int i = 0; i < list->size(); i++) { // Could use binary search to be faster. Float *vloat = list->get(i); - Widget *childAtPoint = - vloat->getWidget()->getWidgetAtPoint (x, y, level + 1); - if (childAtPoint) - return childAtPoint; + if (vloat->getWidget()->wasAllocated ()) { + Widget *childAtPoint = + vloat->getWidget()->getWidgetAtPoint (x, y, level + 1); + if (childAtPoint) + return childAtPoint; + } } return NULL; @@ -1380,9 +1382,12 @@ Widget *OutOfFlowMgr::getAbsolutelyPositionedWidgetAtPoint (int x, int y, { for (int i = 0; i < absolutelyPositioned->size(); i++) { AbsolutelyPositioned *abspos = absolutelyPositioned->get(i); - Widget *childAtPoint = abspos->widget->getWidgetAtPoint (x, y, level + 1); - if (childAtPoint) - return childAtPoint; + if (abspos->widget->wasAllocated ()) { + Widget *childAtPoint = + abspos->widget->getWidgetAtPoint (x, y, level + 1); + if (childAtPoint) + return childAtPoint; + } } return NULL; diff --git a/dw/textblock.cc b/dw/textblock.cc index f8b00012..b822ffb4 100644 --- a/dw/textblock.cc +++ b/dw/textblock.cc @@ -2569,10 +2569,12 @@ core::Widget *Textblock::getWidgetAtPoint(int x, int y, int level) if (word->content.type == core::Content::WIDGET_IN_FLOW) { core::Widget * childAtPoint; - childAtPoint = word->content.widget->getWidgetAtPoint (x, y, - level + 1); - if (childAtPoint) { - return childAtPoint; + if (word->content.widget->wasAllocated ()) { + childAtPoint = word->content.widget->getWidgetAtPoint (x, y, + level + 1); + if (childAtPoint) { + return childAtPoint; + } } } } diff --git a/dw/widget.cc b/dw/widget.cc index 04d1b81d..d3c13d4f 100644 --- a/dw/widget.cc +++ b/dw/widget.cc @@ -904,9 +904,11 @@ Widget *Widget::getWidgetAtPoint (int x, int y, int level) (Content::WIDGET_IN_FLOW | Content::WIDGET_OOF_CONT), false); - while (childAtPoint == NULL && it->next ()) - childAtPoint = it->getContent()->widget->getWidgetAtPoint (x, y, - level + 1); + while (childAtPoint == NULL && it->next ()) { + Widget *child = it->getContent()->widget; + if (child->wasAllocated ()) + childAtPoint = child->getWidgetAtPoint (x, y, level + 1); + } it->unref (); diff --git a/src/dicache.c b/src/dicache.c index 2704da50..7f4cac85 100644 --- a/src/dicache.c +++ b/src/dicache.c @@ -548,24 +548,21 @@ void a_Dicache_cleanup(void) { int i; DICacheNode *node; - DICacheEntry *entry; + DICacheEntry *entry, *next; _MSG("a_Dicache_cleanup\n"); for (i = 0; i < dList_length(CachedIMGs); ++i) { node = dList_nth_data(CachedIMGs, i); /* iterate each entry of this node */ - for (entry = node->first; entry; entry = entry->next) { + for (entry = node->first; entry; entry = next) { + next = entry->next; if (entry->v_imgbuf && a_Imgbuf_last_reference(entry->v_imgbuf)) { /* free this unused entry */ _MSG("a_Dicache_cleanup: removing entry...\n"); - if (entry->next) { - Dicache_remove(node->url, entry->version); - } else { - Dicache_remove(node->url, entry->version); - --i; - break; - } + Dicache_remove(node->url, entry->version); + if (!next && node != dList_nth_data(CachedIMGs, i)) + --i; /* removed node, adjust counter */ } } } |