From b060f6e12d43701c1d8b7ebfd4987a23f3cd23ab Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Fri, 17 Jun 2005 14:11:19 +0000 Subject: [PATCH] don't try to update the top_row rowref ourselves here, but just have 2005-06-17 Kristian Rietveld * gtk/gtktreeview.c (validate_visible_area): don't try to update the top_row rowref ourselves here, but just have _dy_to_top_row() do it, (gtk_tree_view_scroll_to_cell): handle scrolling via validate_visible_area() if the treeview is not visible or needs reallocation. (#165246, Nickolay V. Shmyrev). --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtktreeview.c | 12 +++--------- 4 files changed, 30 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 092cffe471..261eaf40ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): don't try to update + the top_row rowref ourselves here, but just have _dy_to_top_row() + do it, + (gtk_tree_view_scroll_to_cell): handle scrolling via + validate_visible_area() if the treeview is not visible or needs + reallocation. (#165246, Nickolay V. Shmyrev). + 2005-06-17 Kristian Rietveld Fixes #307914 (Alexander Larsson), fixing some breakage caused diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 092cffe471..261eaf40ef 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): don't try to update + the top_row rowref ourselves here, but just have _dy_to_top_row() + do it, + (gtk_tree_view_scroll_to_cell): handle scrolling via + validate_visible_area() if the treeview is not visible or needs + reallocation. (#165246, Nickolay V. Shmyrev). + 2005-06-17 Kristian Rietveld Fixes #307914 (Alexander Larsson), fixing some breakage caused diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 092cffe471..261eaf40ef 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + * gtk/gtktreeview.c (validate_visible_area): don't try to update + the top_row rowref ourselves here, but just have _dy_to_top_row() + do it, + (gtk_tree_view_scroll_to_cell): handle scrolling via + validate_visible_area() if the treeview is not visible or needs + reallocation. (#165246, Nickolay V. Shmyrev). + 2005-06-17 Kristian Rietveld Fixes #307914 (Alexander Larsson), fixing some breakage caused diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 202e2bbd85..a9bb685db4 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -4927,14 +4927,7 @@ validate_visible_area (GtkTreeView *tree_view) dy = 0; gtk_adjustment_set_value (tree_view->priv->vadjustment, dy); - - if (tree_view->priv->top_row) - { - gtk_tree_row_reference_free (tree_view->priv->top_row); - tree_view->priv->top_row = NULL; - } - - tree_view->priv->top_row = gtk_tree_row_reference_new_proxy (G_OBJECT (tree_view), tree_view->priv->model, above_path); + gtk_tree_view_dy_to_top_row (tree_view); need_redraw = TRUE; } @@ -10250,7 +10243,8 @@ gtk_tree_view_scroll_to_cell (GtkTreeView *tree_view, * scrolling code, we short-circuit validate_visible_area's immplementation as * it is much slower than just going to the point. */ - if (! GTK_WIDGET_REALIZED (tree_view) || + if (! GTK_WIDGET_VISIBLE (tree_view) || + GTK_WIDGET_ALLOC_NEEDED (tree_view) || GTK_RBNODE_FLAG_SET (tree_view->priv->tree->root, GTK_RBNODE_DESCENDANTS_INVALID)) { if (tree_view->priv->scroll_to_path)