Commit 2cb9dac1 authored by Benjamin Otte's avatar Benjamin Otte

stylecontext: Pass the changes in the parent to validation function

This way, inherited properties can be updated.
parent 0e2f35ed
......@@ -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
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment