diff options
author | Christian Hergert <chergert@redhat.com> | 2022-05-31 15:58:21 -0700 |
---|---|---|
committer | Christian Hergert <chergert@redhat.com> | 2022-05-31 15:58:21 -0700 |
commit | 63e9e7e8997543827161d288648b2d8b4b95e439 (patch) | |
tree | de25636a2a6796488213a5f348b8676243d3220c | |
parent | 480a933546120f8415f79ec78fe74876351a9bba (diff) | |
download | gtk+-63e9e7e8997543827161d288648b2d8b4b95e439.tar.gz |
builderparser: fix <lookup/> with interface types
If we have a <lookup name="foo" type="SomeInterface"> a runtime warning
would be emitted and the expression would fail to be created. This is
because the interfaces will likely be a GObject as well, meaning we check
the object type branch instead of the interface.
Instead, we need to use the fundamental type like other parts of the
expression system use.
-rw-r--r-- | gtk/gtkbuilderparser.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c index ccfb1cbc56..c2afb64579 100644 --- a/gtk/gtkbuilderparser.c +++ b/gtk/gtkbuilderparser.c @@ -1409,13 +1409,13 @@ expression_info_construct (GtkBuilder *builder, return NULL; } - if (g_type_is_a (type, G_TYPE_OBJECT)) + if (g_type_fundamental (type) == G_TYPE_OBJECT) { GObjectClass *class = g_type_class_ref (type); pspec = g_object_class_find_property (class, info->property.property_name); g_type_class_unref (class); } - else if (g_type_is_a (type, G_TYPE_INTERFACE)) + else if (g_type_fundamental (type) == G_TYPE_INTERFACE) { GTypeInterface *iface = g_type_default_interface_ref (type); pspec = g_object_interface_find_property (iface, info->property.property_name); |