From 51f11dd4972aded458602270ac34f959f2f8f210 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Fri, 17 Jun 2005 11:38:22 +0000 Subject: [PATCH] Fixes #307914 (Alexander Larsson), fixing some breakage caused by my 2005-06-17 Kristian Rietveld Fixes #307914 (Alexander Larsson), fixing some breakage caused by my previous commit. * gtk/gtktreeview.c (validate_visible_area): force dy to be zero when it fits on a single page, (scroll_sync_handler): same here. --- ChangeLog | 9 +++++++++ ChangeLog.pre-2-10 | 9 +++++++++ ChangeLog.pre-2-8 | 9 +++++++++ gtk/gtktreeview.c | 12 +++++++++++- 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 939a1d142c..092cffe471 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + Fixes #307914 (Alexander Larsson), fixing some breakage caused + by my previous commit. + + * gtk/gtktreeview.c (validate_visible_area): force dy to be zero + when it fits on a single page, + (scroll_sync_handler): same here. + Thu Jun 16 15:33:42 2005 Manish Singh * gdk/x11/gdkcursor-x11.c (update_cursor): remove unused variable. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 939a1d142c..092cffe471 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + Fixes #307914 (Alexander Larsson), fixing some breakage caused + by my previous commit. + + * gtk/gtktreeview.c (validate_visible_area): force dy to be zero + when it fits on a single page, + (scroll_sync_handler): same here. + Thu Jun 16 15:33:42 2005 Manish Singh * gdk/x11/gdkcursor-x11.c (update_cursor): remove unused variable. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 939a1d142c..092cffe471 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,12 @@ +2005-06-17 Kristian Rietveld + + Fixes #307914 (Alexander Larsson), fixing some breakage caused + by my previous commit. + + * gtk/gtktreeview.c (validate_visible_area): force dy to be zero + when it fits on a single page, + (scroll_sync_handler): same here. + Thu Jun 16 15:33:42 2005 Manish Singh * gdk/x11/gdkcursor-x11.c (update_cursor): remove unused variable. diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 95499c3deb..202e2bbd85 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -4938,6 +4938,14 @@ validate_visible_area (GtkTreeView *tree_view) need_redraw = TRUE; } + else if (tree_view->priv->height <= tree_view->priv->vadjustment->page_size) + { + /* when we are not scrolling, we should never set dy to something + * else than zero. we update top_row to be in sync with dy = 0. + */ + gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0); + gtk_tree_view_dy_to_top_row (tree_view); + } else gtk_tree_view_top_row_to_dy (tree_view); @@ -5235,7 +5243,9 @@ scroll_sync_handler (GtkTreeView *tree_view) GDK_THREADS_ENTER (); - if (gtk_tree_row_reference_valid (tree_view->priv->top_row)) + if (tree_view->priv->height <= tree_view->priv->vadjustment->page_size) + gtk_adjustment_set_value (GTK_ADJUSTMENT (tree_view->priv->vadjustment), 0); + else if (gtk_tree_row_reference_valid (tree_view->priv->top_row)) gtk_tree_view_top_row_to_dy (tree_view); else gtk_tree_view_dy_to_top_row (tree_view);