summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-07-18 16:55:32 +0200
committerBenjamin Otte <otte@redhat.com>2012-08-28 15:42:23 +0200
commit2cb9dac14c2299c992827863553bd0b019765772 (patch)
treee56e8b05d8c5d3165edd5f9847f15026d34a8045
parent0e2f35ed882ab11d010866d32f2f65232145b8d0 (diff)
downloadgtk+-2cb9dac14c2299c992827863553bd0b019765772.tar.gz
stylecontext: Pass the changes in the parent to validation function
This way, inherited properties can be updated.
-rw-r--r--gtk/gtkcontainer.c7
-rw-r--r--gtk/gtkstylecontext.c9
-rw-r--r--gtk/gtkstylecontextprivate.h4
-rw-r--r--gtk/gtkwindow.c6
4 files changed, 19 insertions, 7 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index ad8ccb5657..f985173b59 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1652,14 +1652,19 @@ gtk_container_idle_sizer (gpointer data)
{
GSList *next = slist->next;
GtkContainer *container = slist->data;
+ GtkBitmask *empty;
+
+ empty = _gtk_bitmask_new ();
container->priv->restyle_pending = FALSE;
_gtk_style_context_validate (gtk_widget_get_style_context (GTK_WIDGET (container)),
current_time,
- 0);
+ 0,
+ empty);
g_slist_free_1 (slist);
slist = next;
+ _gtk_bitmask_free (empty);
}
/* we may be invoked with a container_resize_queue of NULL, because
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 7fd5df398e..a4f3e2c905 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -3028,9 +3028,10 @@ gtk_style_context_start_animations (GtkStyleContext *context,
}
void
-_gtk_style_context_validate (GtkStyleContext *context,
- gint64 timestamp,
- GtkCssChange change)
+_gtk_style_context_validate (GtkStyleContext *context,
+ gint64 timestamp,
+ GtkCssChange change,
+ const GtkBitmask *parent_changes)
{
GtkStyleContextPrivate *priv;
GtkBitmask *changes;
@@ -3141,7 +3142,7 @@ _gtk_style_context_validate (GtkStyleContext *context,
change = _gtk_css_change_for_child (change);
for (list = priv->children; list; list = list->next)
{
- _gtk_style_context_validate (list->data, timestamp, change);
+ _gtk_style_context_validate (list->data, timestamp, change, changes);
}
_gtk_bitmask_free (changes);
diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h
index a62b4675f4..9642793923 100644
--- a/gtk/gtkstylecontextprivate.h
+++ b/gtk/gtkstylecontextprivate.h
@@ -20,6 +20,7 @@
#include "gtkstylecontext.h"
#include "gtksymboliccolor.h"
+#include "gtkbitmaskprivate.h"
#include "gtkcssvalueprivate.h"
G_BEGIN_DECLS
@@ -37,7 +38,8 @@ const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *c
GParamSpec *pspec);
void _gtk_style_context_validate (GtkStyleContext *context,
gint64 timestamp,
- GtkCssChange change);
+ GtkCssChange change,
+ const GtkBitmask*parent_changes);
void _gtk_style_context_queue_invalidate (GtkStyleContext *context,
GtkCssChange change);
gboolean _gtk_style_context_check_region_name (const gchar *str);
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 0d62acc403..2cffb13b85 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -4798,6 +4798,7 @@ gtk_window_show (GtkWidget *widget)
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv;
GtkContainer *container = GTK_CONTAINER (window);
+ GtkBitmask *empty;
gboolean need_resize;
gboolean is_plug;
@@ -4811,9 +4812,12 @@ gtk_window_show (GtkWidget *widget)
need_resize = _gtk_widget_get_alloc_needed (widget) || !gtk_widget_get_realized (widget);
+ empty = _gtk_bitmask_new ();
_gtk_style_context_validate (gtk_widget_get_style_context (widget),
g_get_monotonic_time (),
- 0);
+ 0,
+ empty);
+ _gtk_bitmask_free (empty);
if (need_resize)
{