]> Pileus Git - ~andy/gtk/commitdiff
Fix bug #84268, where validate_rows sometimes didn't remove itself
authorJonathan Blandford <jrb@redhat.com>
Fri, 14 Jun 2002 19:43:12 +0000 (19:43 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Fri, 14 Jun 2002 19:43:12 +0000 (19:43 +0000)
Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>

* gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
didn't remove itself correctly.  Thanks to Dave Camp for the fix.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktreeview.c

index 1de31ae61d27c369801bc281320d3145cb3fd627..2e5fda28c23ccbdb2abc68fca31188f681391caa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
+       didn't remove itself correctly.  Thanks to Dave Camp for the fix.
+
 Fri Jun 14 15:09:11 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_adjustments):
index 1de31ae61d27c369801bc281320d3145cb3fd627..2e5fda28c23ccbdb2abc68fca31188f681391caa 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
+       didn't remove itself correctly.  Thanks to Dave Camp for the fix.
+
 Fri Jun 14 15:09:11 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_adjustments):
index 1de31ae61d27c369801bc281320d3145cb3fd627..2e5fda28c23ccbdb2abc68fca31188f681391caa 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
+       didn't remove itself correctly.  Thanks to Dave Camp for the fix.
+
 Fri Jun 14 15:09:11 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_adjustments):
index 1de31ae61d27c369801bc281320d3145cb3fd627..2e5fda28c23ccbdb2abc68fca31188f681391caa 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
+       didn't remove itself correctly.  Thanks to Dave Camp for the fix.
+
 Fri Jun 14 15:09:11 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_adjustments):
index 1de31ae61d27c369801bc281320d3145cb3fd627..2e5fda28c23ccbdb2abc68fca31188f681391caa 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
+       didn't remove itself correctly.  Thanks to Dave Camp for the fix.
+
 Fri Jun 14 15:09:11 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_adjustments):
index 1de31ae61d27c369801bc281320d3145cb3fd627..2e5fda28c23ccbdb2abc68fca31188f681391caa 100644 (file)
@@ -1,3 +1,8 @@
+Fri Jun 14 15:41:50 2002  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtktreeview.c: Fix bug #84268, where validate_rows sometimes
+       didn't remove itself correctly.  Thanks to Dave Camp for the fix.
+
 Fri Jun 14 15:09:11 2002  Jonathan Blandford  <jrb@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_set_adjustments):
index 9960675d7878db463f929bce728c630154a808c9..e49f6646e7b8d858e301d20a57182a03118400df 100644 (file)
@@ -263,7 +263,7 @@ static gboolean validate_row             (GtkTreeView *tree_view,
                                          GtkTreePath *path);
 static void     validate_visible_area    (GtkTreeView *tree_view);
 static gboolean validate_rows_handler    (GtkTreeView *tree_view);
-static gboolean do_validate_rows        (GtkTreeView *tree_view);
+static gboolean validate_rows            (GtkTreeView *tree_view);
 static gboolean presize_handler_callback (gpointer     data);
 static void     install_presize_handler  (GtkTreeView *tree_view);
 static void     install_scroll_sync_handler (GtkTreeView *tree_view);
@@ -1497,7 +1497,7 @@ gtk_tree_view_size_request (GtkWidget      *widget,
 
   /* we validate 50 rows initially just to make sure we have some size */
   /* in practice, with a lot of static lists, this should get a good width */
-  do_validate_rows (tree_view);
+  validate_rows (tree_view);
   gtk_tree_view_size_request_columns (tree_view);
   gtk_tree_view_update_size (GTK_TREE_VIEW (widget));
 
@@ -4057,10 +4057,8 @@ do_validate_rows (GtkTreeView *tree_view)
   g_assert (tree_view);
 
   if (tree_view->priv->tree == NULL)
-    {
-      tree_view->priv->validate_rows_timer = 0;
       return FALSE;
-    }
+
   do
     {
       if (! GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID))
@@ -4167,12 +4165,26 @@ do_validate_rows (GtkTreeView *tree_view)
     gtk_tree_view_dy_to_top_row (tree_view);
 
   if (path) gtk_tree_path_free (path);
-  if (! retval)
-    tree_view->priv->validate_rows_timer = 0;
 
   return retval;
 }
 
+static gboolean
+validate_rows (GtkTreeView *tree_view)
+{
+  gboolean retval;
+  
+  retval = do_validate_rows (tree_view);
+  
+  if (! retval && tree_view->priv->validate_rows_timer)
+    {
+      g_source_remove (tree_view->priv->validate_rows_timer);
+      tree_view->priv->validate_rows_timer = 0;
+    }
+  
+    return retval;
+  }
+
 static gboolean
 validate_rows_handler (GtkTreeView *tree_view)
 {
@@ -4181,7 +4193,9 @@ validate_rows_handler (GtkTreeView *tree_view)
   GDK_THREADS_ENTER ();
 
   retval = do_validate_rows (tree_view);
-  
+  if (! retval)
+    tree_view->priv->validate_rows_timer = 0;
+
   GDK_THREADS_LEAVE ();
 
   return retval;
@@ -4347,7 +4361,7 @@ _gtk_tree_view_install_mark_rows_col_dirty (GtkTreeView *tree_view)
 }
 
 /*
- * This function works synchronously (due to the while (do_validate_rows...)
+ * This function works synchronously (due to the while (validate_rows...)
  * loop).
  *
  * There was a check for column_type != GTK_TREE_VIEW_COLUMN_AUTOSIZE
@@ -4363,7 +4377,7 @@ _gtk_tree_view_column_autosize (GtkTreeView *tree_view,
   _gtk_tree_view_column_cell_set_dirty (column, FALSE);
 
   do_presize_handler (tree_view);
-  while (do_validate_rows (tree_view));
+  while (validate_rows (tree_view));
 
   gtk_widget_queue_resize (GTK_WIDGET (tree_view));
 }