Avoid criticals on headless systems
If we don't have a monitor, don't try to use it. This avoids pointless critical warnings on headless systems.
This commit is contained in:
@@ -10984,7 +10984,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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user