[gtk/wip/otte/listview: 145/158] widget: Do parent_class handling properly



commit cbf41caa0bd8182b4720701309da120e4b9fd1d4
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 982f36b1b2..d15e31218f 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12985,9 +12985,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]