diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 2b39f28f39..587bf81b0f 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -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; } /**