[gtk+/composite-templates] stylecontext: Pass the changes in the parent to validation function
- From: Juan Pablo Ugarte <jpu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/composite-templates] stylecontext: Pass the changes in the parent to validation function
- Date: Fri, 14 Sep 2012 21:20:56 +0000 (UTC)
commit de9d883f8caa931e7c924188a551cf02acc775b4
Author: Benjamin Otte <otte redhat com>
Date: Wed Jul 18 16:55:32 2012 +0200
stylecontext: Pass the changes in the parent to validation function
This way, inherited properties can be updated.
gtk/gtkcontainer.c | 7 ++++++-
gtk/gtkstylecontext.c | 9 +++++----
gtk/gtkstylecontextprivate.h | 4 +++-
gtk/gtkwindow.c | 6 +++++-
4 files changed, 19 insertions(+), 7 deletions(-)
---
diff --git a/gtk/gtkcontainer.c b/gtk/gtkcontainer.c
index bc67cfe..54c5ef7 100644
--- a/gtk/gtkcontainer.c
+++ b/gtk/gtkcontainer.c
@@ -1937,14 +1937,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 7fd5df3..a4f3e2c 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 a62b467..9642793 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 0d62acc..2cffb13 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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]