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



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

    GtkWidget: Set screen info in GtkStyleContext.

 gtk/gtkwidget.c |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index a63d85f..87f52f7 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -7127,6 +7127,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));
     }
 }
 
@@ -7728,14 +7731,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);
     }
 }
@@ -12633,6 +12642,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]