[gtk+/gtk-3-12] treeview: Fix prelight redraw when adjustment changes



commit 281ca4905adf4bab4355789bab09d255a9c4c283
Author: Alexander Larsson <alexl redhat com>
Date:   Tue Apr 29 09:08:31 2014 +0200

    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 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 1469254..9c06762 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);
-       }
+
+        }
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]