[gtk/matthiasc/for-master] expression: Fix property expressions for interfaces



commit 48dcbf4935444a75974c50c1a9900e38f1e314c6
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Oct 30 22:24:53 2020 -0400

    expression: Fix property expressions for interfaces
    
    We were not checking the passed-in type in the right
    way. An interface type can still pass the
    g_type_is_a (..., G_TYPE_OBJECT) check, if G_TYPE_OBJECT
    is one of its prerequisites. What we need to check is
    whether the fundamental type is G_TYPE_OBJECT.

 gtk/gtkexpression.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkexpression.c b/gtk/gtkexpression.c
index f7c25f9c73..0974face66 100644
--- a/gtk/gtkexpression.c
+++ b/gtk/gtkexpression.c
@@ -1283,13 +1283,13 @@ gtk_property_expression_new (GType          this_type,
 {
   GParamSpec *pspec;
 
-  if (g_type_is_a (this_type, G_TYPE_OBJECT))
+  if (g_type_fundamental (this_type) == G_TYPE_OBJECT)
     {
       GObjectClass *class = g_type_class_ref (this_type);
       pspec = g_object_class_find_property (class, property_name);
       g_type_class_unref (class);
     }
-  else if (g_type_is_a (this_type, G_TYPE_INTERFACE))
+  else if (g_type_fundamental (this_type) == G_TYPE_INTERFACE)
     {
       GTypeInterface *iface = g_type_default_interface_ref (this_type);
       pspec = g_object_interface_find_property (iface, property_name);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]