summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-19 18:10:35 -0300
committerJuan Pablo Ugarte <juanpablougarte@gmail.com>2020-06-19 18:10:35 -0300
commita409f29dc7f2ce24c429a791060ddeb8cda6877f (patch)
tree01f94effc50e11a4ad8ef92fb297e45022008b42
parente1e889cfabce01333666fe005e476c33c4ea79b8 (diff)
downloadglade-a409f29dc7f2ce24c429a791060ddeb8cda6877f.tar.gz
GladeStandarStock, GladeStandarStockImage: fix get_type() functions for introspection
Avoid trying to register stock icons when there is no default display like when running introspection scanner. This prevents some really annoying warnings and should help with https://gitlab.gnome.org/GNOME/glade/-/issues/432
-rw-r--r--gladeui/glade-builtins.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gladeui/glade-builtins.c b/gladeui/glade-builtins.c
index 8dbe6a5c..beadc5cb 100644
--- a/gladeui/glade-builtins.c
+++ b/gladeui/glade-builtins.c
@@ -292,6 +292,9 @@ glade_standard_stock_get_type (void)
(GEnumValue *) g_array_free (values,
FALSE));
+ if (gdk_display_get_default () == NULL)
+ return etype;
+
/* Register displayable by GType, i.e. after the types been created. */
for (i = 0; i < n_values; i++)
{
@@ -329,6 +332,9 @@ glade_standard_stock_image_get_type (void)
(GEnumValue *) g_array_free (values,
FALSE));
+ if (gdk_display_get_default () == NULL)
+ return etype;
+
/* Register displayable by GType, i.e. after the types been created. */
for (i = 0; i < n_values; i++)
{