--- a/gnttree.c Mon Apr 06 10:30:25 2009 +0000
+++ b/gnttree.c Wed Apr 08 12:35:09 2009 +0000
@@ -432,7 +432,7 @@
- if (tree->current == NULL) {
+ if (tree->current == NULL && tree->root != NULL) { tree->current = tree->root;
tree_selection_changed(tree, NULL, tree->current);
@@ -491,6 +491,13 @@
tree->top = get_next(tree->top);
scrcol = widget->priv.width - 1 - 2 * pos; /* exclude the borders and the scrollbar */
+ if (tree->current && !row_matches_search(tree->current)) { + GntTreeRow *old = tree->current; + tree->current = tree->top; + tree_selection_changed(tree, old, tree->current); for (i = start + pos; row && i < widget->priv.height - pos;
i++, row = get_next(row))