widget: gdk_display_get_monitor can return NULL

Fixes #1466
This commit is contained in:
Timm Bäder 2018-11-20 12:44:23 +01:00
parent 08a07d4ae5
commit d76a0feef6

View File

@ -7617,7 +7617,10 @@ gtk_widget_get_scale_factor (GtkWidget *widget)
display = _gtk_widget_get_display (widget);
monitor = gdk_display_get_monitor (display, 0);
return gdk_monitor_get_scale_factor (monitor);
if (monitor)
return gdk_monitor_get_scale_factor (monitor);
return 1;
}
/**