print: Avoid calling gdk_display_get_default

Check if GTK has been initialized before trying to get a display
in a class_init function. The introspection property dumper code
will instantiate all types and run into the new introduced errors
if we try to get a display in class_init.
This commit is contained in:
Matthias Clasen
2024-10-15 21:37:09 -04:00
parent 84779ccdbc
commit 51f3f6f8d1

View File

@@ -368,6 +368,9 @@ ensure_fallback_style (void)
GdkDisplay *display;
GtkCssProvider *provider;
if (!gtk_is_initialized ())
return;
display = gdk_display_get_default ();
if (!display)
return;