[gtk+/gtk-style-context: 122/191] GtkWidget: Set screen info in GtkStyleContext.



commit 7515575d29c5636c05afcf33d4d54bb602e21960
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sat Jul 3 13:20:45 2010 +0200

    GtkWidget: Set screen info in GtkStyleContext.

 gtk/gtkwidget.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index f907ee9..d422be1 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3499,7 +3499,6 @@ gtk_widget_realize (GtkWidget *widget)
 {
   GdkExtensionMode mode;
   GtkWidgetShapeInfo *shape_info;
-  GtkStyleContext *context;
   
   g_return_if_fail (GTK_IS_WIDGET (widget));
   g_return_if_fail (GTK_WIDGET_ANCHORED (widget) ||
@@ -6440,6 +6439,9 @@ gtk_widget_set_parent (GtkWidget *widget,
       path = gtk_widget_get_path (widget);
       gtk_style_context_set_path (context, path);
       gtk_widget_path_free (path);
+
+      gtk_style_context_set_screen (context,
+                                    gtk_widget_get_screen (widget));
     }
 }
 
@@ -7033,14 +7035,20 @@ do_screen_change (GtkWidget *widget,
 {
   if (old_screen != new_screen)
     {
+      GtkStyleContext *context;
+
       if (old_screen)
 	{
 	  PangoContext *context = g_object_get_qdata (G_OBJECT (widget), quark_pango_context);
 	  if (context)
 	    g_object_set_qdata (G_OBJECT (widget), quark_pango_context, NULL);
 	}
-      
+
       _gtk_tooltip_hide (widget);
+
+      context = gtk_widget_get_style_context (widget);
+      gtk_style_context_set_screen (context, new_screen);
+
       g_signal_emit (widget, widget_signals[SCREEN_CHANGED], 0, old_screen);
     }
 }
@@ -11604,6 +11612,9 @@ gtk_widget_get_style_context (GtkWidget *widget)
           path = gtk_widget_get_path (widget);
           gtk_style_context_set_path (context, path);
           gtk_widget_path_free (path);
+
+          gtk_style_context_set_screen (context,
+                                        gtk_widget_get_screen (widget));
         }
     }
 



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