[gtk/wip/otte/listview: 148/150] widget: Do parent_class handling properly



commit 71fd74c88f10588b82881486424ef5edc4514430
Author: Benjamin Otte <otte redhat com>
Date:   Tue Nov 26 19:40:29 2019 +0100

    widget: Do parent_class handling properly
    
    The previous cosde did not actually query the parent class, it just did
    a very complicated C cast.

 gtk/gtkwidget.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 39d2e60e50..2b4e68f423 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -13524,9 +13524,9 @@ gtk_widget_class_add_action (GtkWidgetClass  *widget_class,
 
   if (priv->actions == NULL)
     priv->actions = g_ptr_array_new ();
-  else if (GTK_IS_WIDGET_CLASS (&widget_class->parent_class))
+  else if (G_TYPE_FROM_CLASS (widget_class) != GTK_TYPE_WIDGET)
     {
-      GtkWidgetClass *parent_class = GTK_WIDGET_CLASS (&widget_class->parent_class);
+      GtkWidgetClass *parent_class = GTK_WIDGET_CLASS (g_type_class_peek_parent (widget_class));
       GtkWidgetClassPrivate *parent_priv = parent_class->priv;
       GPtrArray *parent_actions = parent_priv->actions;
 


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