pidgin: d3339fef: - Don't bother changing/signalling the s..

wabz at pidgin.im wabz at pidgin.im
Wed Apr 8 08:40:33 EDT 2009


-----------------------------------------------------------------
Revision: d3339fef344e4e01a21229a086a44397836f4638
Ancestor: 5ac03deda57981951c593dd61f0aef4d31625eec
Author: wabz at pidgin.im
Date: 2009-04-08T12:35:09
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/d3339fef344e4e01a21229a086a44397836f4638

Modified files:
        finch/libgnt/gnttree.c

ChangeLog: 

- Don't bother changing/signalling the selected row from NULL to NULL
- Ensure the selected row is a visible row when searching the tree.

-------------- next part --------------
============================================================
--- finch/libgnt/gnttree.c	5109f450f37b656762fc0db5269b501f61e1e6b4
+++ finch/libgnt/gnttree.c	d9cb52881de1074984623684be86bcadd6c2e66e
@@ -432,7 +432,7 @@ redraw_tree(GntTree *tree)
 
 	if (tree->top == NULL)
 		tree->top = tree->root;
-	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 @@ redraw_tree(GntTree *tree)
 		tree->top = get_next(tree->top);
 	row = 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))
 	{


More information about the Commits mailing list