[gtk+] widget: Set up signals after initializing style context



commit 5d579811843f81db9866ac81afc5297f776cfb3b
Author: Benjamin Otte <otte redhat com>
Date:   Fri Mar 9 12:35:58 2012 +0100

    widget: Set up signals after initializing style context
    
    Otherwise, signals would be emitted on semi set up style context which
    would then cause crashes when the signal handlers tried to use them.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=662023

 gtk/gtkwidget.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c4c85c9..a82f050 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -14119,9 +14119,6 @@ gtk_widget_get_style_context (GtkWidget *widget)
                                     "direction", gtk_widget_get_direction (widget),
                                     NULL);
 
-      g_signal_connect (widget->priv->context, "changed",
-                        G_CALLBACK (style_context_changed), widget);
-
       screen = gtk_widget_get_screen (widget);
 
       if (screen)
@@ -14131,6 +14128,9 @@ gtk_widget_get_style_context (GtkWidget *widget)
       if (priv->parent)
         gtk_style_context_set_parent (priv->context,
                                       gtk_widget_get_style_context (priv->parent));
+
+      g_signal_connect (widget->priv->context, "changed",
+                        G_CALLBACK (style_context_changed), widget);
     }
 
   return widget->priv->context;



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