summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-01-24 15:44:03 +0100
committerBenjamin Otte <otte@redhat.com>2012-01-24 17:55:14 +0100
commit2f3ffd5fde41c7e62a30ea2579234c9e9d74b51b (patch)
tree8b259d5d23a01dd170bac2b935cd4c12ed6ffaee
parent080f8740f27db22e7dc556723505753e3a937580 (diff)
downloadgtk+-2f3ffd5fde41c7e62a30ea2579234c9e9d74b51b.tar.gz
treeview: Fix comparison to catch all cases
Otherwise, we could sometimes fail to update the cursor node when the right row was deleted. Also, I'd like to file a formal complaint that this node/tree differentiation makes writing comparisons too complicated. https://bugzilla.gnome.org/show_bug.cgi?id=668169
-rw-r--r--gtk/gtktreeview.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 72564854f9..993a41b110 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -9025,7 +9025,8 @@ gtk_tree_view_row_deleted (GtkTreeModel *model,
/* If the cursor row got deleted, move the cursor to the next row */
if (tree_view->priv->cursor_node &&
(tree_view->priv->cursor_node == node ||
- (node->children && _gtk_rbtree_contains (node->children, tree_view->priv->cursor_tree))))
+ (node->children && (tree_view->priv->cursor_tree == node->children ||
+ _gtk_rbtree_contains (node->children, tree_view->priv->cursor_tree)))))
{
GtkTreePath *cursor_path;