[gtk+] Make treeview cursor handling a bit more robust



commit 14e3340647da3d5de0018f2b75dd63684e5d8933
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Oct 30 13:57:33 2013 -0400

    Make treeview cursor handling a bit more robust
    
    Clearing the model in a GtkTreeSelection::changed handler was
    crashing. While it is not a 100% kosher thing to do, lets be
    more robust here.

 gtk/gtktreeview.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index f141e2f..2ee1bb7 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -13163,7 +13163,8 @@ gtk_tree_view_real_set_cursor (GtkTreeView     *tree_view,
        */
       _gtk_tree_view_find_node (tree_view, path, &new_tree, &new_node);
 
-      if (tree_view->priv->cursor_node != new_node)
+      if (tree_view->priv->cursor_node == NULL ||
+          tree_view->priv->cursor_node != new_node)
         return;
 
       if (flags & CLAMP_NODE)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]