[gtk+/gtk-style-context: 27/260] GtkWidget: Add widget path to style context.
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-style-context: 27/260] GtkWidget: Add widget path to style context.
- Date: Wed, 20 Oct 2010 10:23:41 +0000 (UTC)
commit a1006bae833b57b5347f506040ca13ed38a3a397
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Mar 20 13:30:05 2010 +0100
GtkWidget: Add widget path to style context.
gtk/gtkwidget.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 7e0b4e6..8691785 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4130,6 +4130,7 @@ gtk_widget_realize (GtkWidget *widget)
GtkWidgetPrivate *priv;
GdkExtensionMode mode;
cairo_region_t *region;
+ GtkStyleContext *context;
g_return_if_fail (GTK_IS_WIDGET (widget));
g_return_if_fail (widget->priv->anchored ||
@@ -4179,6 +4180,17 @@ gtk_widget_realize (GtkWidget *widget)
gdk_window_set_support_multidevice (priv->window, TRUE);
_gtk_widget_enable_device_events (widget);
+
+ context = g_object_get_qdata (G_OBJECT (widget),
+ quark_style_context);
+ if (context)
+ {
+ GtkWidgetPath *path;
+
+ path = gtk_widget_get_path (widget);
+ gtk_style_context_set_path (context, path);
+ gtk_widget_path_free (path);
+ }
}
}
@@ -13252,5 +13264,14 @@ gtk_widget_get_style_context (GtkWidget *widget)
(GDestroyNotify) g_object_unref);
}
+ if (GTK_WIDGET_REALIZED (widget))
+ {
+ GtkWidgetPath *path;
+
+ path = gtk_widget_get_path (widget);
+ gtk_style_context_set_path (context, path);
+ gtk_widget_path_free (path);
+ }
+
return context;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]