[gtk/prop-list: 148/179] widget: Do parent_class handling properly
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/prop-list: 148/179] widget: Do parent_class handling properly
- Date: Sun, 15 Dec 2019 17:38:04 +0000 (UTC)
commit d72ffdd003a54460493d29ac2bf2933070b7614e
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]