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
This commit is contained in:
parent
6fb69a3e09
commit
c0a87a85f4
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user