diff options
author | Benjamin Otte <otte@redhat.com> | 2012-04-07 22:44:00 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-04-17 08:59:21 +0200 |
commit | 29fbfcb8f5149a2b62c14ee38e0a381fd7dc2e2b (patch) | |
tree | 6c53d109c387ee95edd6932002368f3bd83328e5 /gtk | |
parent | aaedc7b67fbe6d74fe75d2a4011777d794eeac60 (diff) | |
download | gtk+-29fbfcb8f5149a2b62c14ee38e0a381fd7dc2e2b.tar.gz |
stylecontext: Pass time to style_context_validate()
This way, we can ensure that every style context uses the same timestamp
for whatever they do.
Diffstat (limited to 'gtk')
-rw-r--r-- | gtk/gtkcontainer.c | 10 | ||||
-rw-r--r-- | gtk/gtkstylecontext.c | 3 | ||||
-rw-r--r-- | gtk/gtkstylecontextprivate.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c index 425eea8c8f..e3fabe81e0 100644 --- a/gtk/gtkcontainer.c +++ b/gtk/gtkcontainer.c @@ -1643,6 +1643,7 @@ static gboolean gtk_container_idle_sizer (gpointer data) { GSList *slist; + gint64 current_time; /* we may be invoked with a container_resize_queue of NULL, because * queue_resize could have been adding an extra idle function while @@ -1657,9 +1658,12 @@ gtk_container_idle_sizer (gpointer data) * because size_allocate functions often change styles and so could * cause infinite loops in this function. */ + current_time = g_get_monotonic_time (); for (slist = container_resize_queue; slist; slist = slist->next) { - _gtk_style_context_validate (gtk_widget_get_style_context (slist->data), 0); + _gtk_style_context_validate (gtk_widget_get_style_context (slist->data), + current_time, + 0); } while (container_resize_queue) @@ -1728,7 +1732,9 @@ _gtk_container_queue_resize_internal (GtkContainer *container, break; case GTK_RESIZE_IMMEDIATE: - _gtk_style_context_validate (gtk_widget_get_style_context (GTK_WIDGET (resize_container)), 0); + _gtk_style_context_validate (gtk_widget_get_style_context (GTK_WIDGET (resize_container)), + g_get_monotonic_time (), + 0); gtk_container_check_resize (resize_container); break; diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index b50f9d0602..2d8023c298 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -2787,6 +2787,7 @@ gtk_style_context_do_invalidate (GtkStyleContext *context) void _gtk_style_context_validate (GtkStyleContext *context, + gint64 timestamp, GtkCssChange change) { GtkStyleContextPrivate *priv; @@ -2860,7 +2861,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, change); + _gtk_style_context_validate (list->data, timestamp, change); } } diff --git a/gtk/gtkstylecontextprivate.h b/gtk/gtkstylecontextprivate.h index 08f21b32e8..c6ab2cc0c8 100644 --- a/gtk/gtkstylecontextprivate.h +++ b/gtk/gtkstylecontextprivate.h @@ -36,6 +36,7 @@ const GValue * _gtk_style_context_peek_style_property (GtkStyleContext *c GtkStateFlags state, GParamSpec *pspec); void _gtk_style_context_validate (GtkStyleContext *context, + gint64 timestamp, GtkCssChange change); void _gtk_style_context_queue_invalidate (GtkStyleContext *context, GtkCssChange change); |