treeview: Don't create an overly large pixel cache

GPUs generally have problems when you create a 35000px wide surface.
Luckily X catches this and sends a BadAlloc. Which GTK immediately
abort()s on.

Testcase included.

https://bugzilla.redhat.com/show_bug.cgi?id=1163579
This commit is contained in:
Benjamin Otte 2015-01-24 03:29:18 +01:00
parent 98ee594f73
commit 7eecb16404
4 changed files with 104 additions and 2 deletions

View File

@ -5580,8 +5580,8 @@ gtk_tree_view_draw (GtkWidget *widget,
view_rect.x = 0;
view_rect.y = gtk_tree_view_get_effective_header_height (tree_view);
view_rect.width = gdk_window_get_width (tree_view->priv->bin_window);
view_rect.height = gdk_window_get_height (tree_view->priv->bin_window);
view_rect.width = gtk_widget_get_allocated_width (widget);
view_rect.height = gtk_widget_get_allocated_width (widget) - view_rect.y;
gdk_window_get_position (tree_view->priv->bin_window, &canvas_rect.x, &canvas_rect.y);
canvas_rect.y = -gtk_adjustment_get_value (tree_view->priv->vadjustment);

View File

@ -420,6 +420,8 @@ testdata = \
textview-margins.ui \
toplevel-vs-popup.ref.ui \
toplevel-vs-popup.ui \
treeview-crash-too-wide.ref.ui \
treeview-crash-too-wide.ui \
treeview-fixed-height.css \
treeview-fixed-height.ref.ui \
treeview-fixed-height.ui \

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long