Fix warnings in the font options code
authorMatthias Clasen <mclasen@redhat.com>
Thu, 2 Jul 2015 06:36:29 +0000 (23:36 -0700)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 2 Jul 2015 06:36:29 +0000 (23:36 -0700)
This code gets called before a screen is set.

gtk/gtkwidget.c

index f53743341823568d64cbd09309f8d1120f5b3a16..92e0dc5f83502766c005d5e055f9cae07457e129 100644 (file)
@@ -10336,7 +10336,7 @@ update_pango_context (GtkWidget    *widget,
                                           100));
 
   screen = gtk_widget_get_screen_unchecked (widget);
-  if (widget->priv->font_options)
+  if (screen && widget->priv->font_options)
     {
       cairo_font_options_t *options;
 
@@ -10345,7 +10345,7 @@ update_pango_context (GtkWidget    *widget,
       pango_cairo_context_set_font_options (context, options);
       cairo_font_options_destroy (options);
     }
-  else
+  else if (screen)
     {
       pango_cairo_context_set_font_options (context,
                                             gdk_screen_get_font_options (screen));