From c0a87a85f4acdab8690302ee5af5a220b1cce9d0 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Tue, 29 Apr 2014 09:08:31 +0200 Subject: [PATCH] treeview: Fix prelight redraw when adjustment changes When the adjustment changes (due to e.g. a mouse wheel scroll) we update the prelight. The part that un-prelights the previous prelight was broken by the the pixel cache, as it called update_prelight in the middle of the scrolling operation, where the windows were moved but the tree_view->priv->dy was not changed to the new value. This caused the updates to the pixel cache to go to the wrong place. We fix this by fully doing the scroll before we update_prelight(). https://bugzilla.gnome.org/show_bug.cgi?id=728284 --- gtk/gtktreeview.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c index 1469254694..9c0676287b 100644 --- a/gtk/gtktreeview.c +++ b/gtk/gtktreeview.c @@ -11218,24 +11218,23 @@ gtk_tree_view_adjustment_changed (GtkAdjustment *adjustment, - gtk_adjustment_get_value (tree_view->priv->hadjustment), 0); dy = tree_view->priv->dy - (int) gtk_adjustment_get_value (tree_view->priv->vadjustment); - if (dy) - { - update_prelight (tree_view, - tree_view->priv->event_last_x, - tree_view->priv->event_last_y - dy); - } tree_view->priv->in_scroll = TRUE; gdk_window_scroll (tree_view->priv->bin_window, 0, dy); tree_view->priv->in_scroll = FALSE; - if (tree_view->priv->dy != (int) gtk_adjustment_get_value (tree_view->priv->vadjustment)) + if (dy != 0) { /* update our dy and top_row */ tree_view->priv->dy = (int) gtk_adjustment_get_value (tree_view->priv->vadjustment); + update_prelight (tree_view, + tree_view->priv->event_last_x, + tree_view->priv->event_last_y); + if (!tree_view->priv->in_top_row_to_dy) gtk_tree_view_dy_to_top_row (tree_view); - } + + } } }