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:13:54 -0300
commitdbad3f508d4bcce1b71af6f863abbfd989f27ede (patch)
treecb657e9cdd7b8c46980ec9c1126a0d0955145c55
parent3361ba978815856edee492b90ffcbb9899344378 (diff)
downloadglade-dbad3f508d4bcce1b71af6f863abbfd989f27ede.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++)
{