diff options
author | Daniel Drake <drake@endlessm.com> | 2016-09-26 13:18:59 -0600 |
---|---|---|
committer | Cosimo Cecchi <cosimo@endlessm.com> | 2016-09-26 14:23:51 -0700 |
commit | fa23641992e0fc1e7ec64c56975d7b13d7d0de1b (patch) | |
tree | 72fc7aba2cb0571c69fb06bd83389a887453d2f5 | |
parent | fe216b0039bb4344d715421245327ce3547c0a08 (diff) | |
download | gtk+-fa23641992e0fc1e7ec64c56975d7b13d7d0de1b.tar.gz |
_gtk_icon_helper_draw: get style earlier
After checking for rendered_surface, the call to gtk_css_node_get_style
can invalidate the style and result in rendered_surface being set to
NULL. This was result in some icon views appearing blank on
Endless OS on armv7hl, and this error:
Gtk-CRITICAL **: gtk_css_style_render_icon_surface: assertion 'surface != NULL' failed
Call gtk_css_node_get_style earlier to ensure we always pass a valid
surface to gtk_css_style_render_icon_surface.
https://bugzilla.gnome.org/show_bug.cgi?id=765649
https://phabricator.endlessm.com/T13524
-rw-r--r-- | gtk/gtkiconhelper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c index b8737e7aa4..7ef33ae300 100644 --- a/gtk/gtkiconhelper.c +++ b/gtk/gtkiconhelper.c @@ -892,11 +892,12 @@ _gtk_icon_helper_draw (GtkIconHelper *self, gdouble x, gdouble y) { + GtkCssStyle *style = gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))); gtk_icon_helper_ensure_surface (self); if (self->priv->rendered_surface != NULL) { - gtk_css_style_render_icon_surface (gtk_css_node_get_style (gtk_css_gadget_get_node (GTK_CSS_GADGET (self))), + gtk_css_style_render_icon_surface (style, cr, self->priv->rendered_surface, x, y); |