summaryrefslogtreecommitdiff
path: root/gtk/gtktreeview.c
diff options
context:
space:
mode:
authorTimm Bäder <mail@baedert.org>2018-07-08 10:32:12 +0200
committerTimm Bäder <mail@baedert.org>2018-07-08 10:32:12 +0200
commitc85e2401fa439191fe6151212fffef9e2c2888c0 (patch)
treed1deeb33b4ae19bbb63407fa37fb2634ba4834d9 /gtk/gtktreeview.c
parent6fdcafc94ab56550103ef150487077328bab9a0f (diff)
downloadgtk+-c85e2401fa439191fe6151212fffef9e2c2888c0.tar.gz
treeview: Fix column visibility check
This is still fallout from the bin_window removal. We aren't moving the GdkWindow/GdkSurface anymore so we have to account for the scrolling ourselves.
Diffstat (limited to 'gtk/gtktreeview.c')
-rw-r--r--gtk/gtktreeview.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index cf95a768bb..c437ac75e4 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -4538,6 +4538,8 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
GtkSnapshot *snapshot)
{
GtkTreeView *tree_view = GTK_TREE_VIEW (widget);
+ GtkTreeViewPrivate *priv = gtk_tree_view_get_instance_private (tree_view);
+ const int x_scroll_offset = - gtk_adjustment_get_value (priv->hadjustment);
GtkTreePath *path;
GtkRBTree *tree;
GList *list;
@@ -4658,7 +4660,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
max_height = gtk_tree_view_get_row_height (tree_view, node);
- cell_offset = 0;
+ cell_offset = x_scroll_offset;
background_area.y = y_offset + clip.y;
background_area.height = max_height;
@@ -4731,7 +4733,7 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
else
flags &= ~GTK_CELL_RENDERER_EXPANDED;
- background_area.x = cell_offset;
+ background_area.x = cell_offset;
background_area.width = width;
cell_area = background_area;
@@ -4768,6 +4770,9 @@ gtk_tree_view_bin_snapshot (GtkWidget *widget,
continue;
}
+ background_area.x -= x_scroll_offset;
+ cell_area.x -= x_scroll_offset;
+
gtk_tree_view_column_cell_set_cell_data (column,
tree_view->priv->model,
&iter,