? gail-patch.diff
? gail-zip
? idle-expand-patch.diff
? stamp-h1
? docs/reference/libgail-util/gail-libgail-util.interfaces
? docs/reference/libgail-util/gail-libgail-util.prerequisites
Index: gail/gailtreeview.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtreeview.c,v
retrieving revision 1.180
diff -u -r1.180 gailtreeview.c
--- gail/gailtreeview.c	5 Oct 2005 15:57:38 -0000	1.180
+++ gail/gailtreeview.c	6 Oct 2005 11:17:42 -0000
@@ -360,15 +360,6 @@
   gboolean in_use;
 };
 
-typedef struct _GailTreeViewIdleData   GailTreeViewIdleData;
-
-struct _GailTreeViewIdleData
-{
-  GailTreeView *tree_view;
-  GtkTreePath  *path;
-};
-
-
 GType
 gail_tree_view_get_type (void)
 {
@@ -495,6 +486,7 @@
   view->old_hadj = NULL;
   view->old_vadj = NULL;
   view->idle_expand_id = 0;
+  view->idle_expand_path = NULL;
 
   view->n_children_deleted = 0;
 
@@ -2236,26 +2228,21 @@
 {
   AtkObject *atk_obj = gtk_widget_get_accessible (GTK_WIDGET (tree_view));
   GailTreeView *gailview = GAIL_TREE_VIEW (atk_obj);
-  GailTreeViewIdleData *data;
-
   /*
    * The visible rectangle has not been updated when this signal is emitted
    * so we process the signal when the GTK processing is completed
    */
-  data = g_new (GailTreeViewIdleData, 1);
-  data->tree_view = gailview;
-  data->path = gtk_tree_path_copy (path);
-  gailview->idle_expand_id = g_idle_add (idle_expand_row, data);
-
+  /* this seems wrong since it overwrites any other pending expand handlers... */
+  gailview->idle_expand_path = gtk_tree_path_copy (path);
+  gailview->idle_expand_id = g_idle_add (idle_expand_row, gailview);
   return FALSE;
 }
 
 static gint
 idle_expand_row (gpointer data)
 {
-  GailTreeViewIdleData *idle_data = (GailTreeViewIdleData *) data;
-  GailTreeView *gailview = idle_data->tree_view;
-  GtkTreePath *path = idle_data->path;
+  GailTreeView *gailview = data;
+  GtkTreePath *path = gailview->idle_expand_path;
   GtkTreeView *tree_view = GTK_TREE_VIEW (GTK_ACCESSIBLE (gailview)->widget);
   GtkTreeIter iter;
   GtkTreeModel *tree_model;
@@ -2263,7 +2250,7 @@
 
   tree_model = gtk_tree_view_get_model(tree_view);
   if (!gtk_tree_model_get_iter (tree_model, &iter, path))
-    g_assert_not_reached ();
+      return FALSE;
 
   /*
    * Update visibility of cells below expansion row
@@ -2775,6 +2762,10 @@
   if (gailview->idle_expand_id)
     {
       g_source_remove (gailview->idle_expand_id);
+      /* don't do this if the insertion precedes the idle path, since it will now be invalid */
+      if (gtk_tree_path_compare (path, gailview->idle_expand_path) > 0)
+	  set_expand_state (tree_view, tree_model, gailview, gailview->idle_expand_path, FALSE);
+      gtk_tree_path_free (gailview->idle_expand_path);
       gailview->idle_expand_id = 0;
     }
   /* Check to see if row is visible */
@@ -2863,6 +2854,7 @@
   if (gailview->idle_expand_id)
     {
       g_source_remove (gailview->idle_expand_id);
+      gtk_tree_path_free (gailview->idle_expand_path);
       gailview->idle_expand_id = 0;
     }
   /* Check to see if row is visible */
@@ -2931,6 +2923,7 @@
   if (gailview->idle_expand_id)
     {
       g_source_remove (gailview->idle_expand_id);
+      gtk_tree_path_free (gailview->idle_expand_path);
       gailview->idle_expand_id = 0;
     }
   traverse_cells (gailview, NULL, TRUE, FALSE);
Index: gail/gailtreeview.h
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtreeview.h,v
retrieving revision 1.25
diff -u -r1.25 gailtreeview.h
--- gail/gailtreeview.h	5 Oct 2005 15:57:38 -0000	1.25
+++ gail/gailtreeview.h	6 Oct 2005 11:17:42 -0000
@@ -54,6 +54,7 @@
   GtkAdjustment *old_vadj;
   guint         idle_expand_id;
   guint         idle_garbage_collect_id;
+  GtkTreePath   *idle_expand_path;
   gboolean      garbage_collection_pending;
 };
 
