[gtk+/gtk-style-context: 27/251] 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/251] GtkWidget: Add widget path to style context.
- Date: Tue, 12 Oct 2010 01:57:23 +0000 (UTC)
commit 8c5e242bfdf0e9e62ff81d0637d16714736a1a6f
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 0a291cf..9358be0 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3896,6 +3896,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 ||
@@ -3945,6 +3946,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);
+ }
}
}
@@ -12554,5 +12566,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]