[gtk/wip/otte/listview: 1027/1040] widget: Do parent_class handling properly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/otte/listview: 1027/1040] widget: Do parent_class handling properly
- Date: Sun, 2 Feb 2020 23:49:01 +0000 (UTC)
commit 927f88567e67e9d18dc796f424aa5fa7d405fb31
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 684620d4d5..e18001e302 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -12982,9 +12982,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]