summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-10-01 15:43:21 +0200
committerBenjamin Otte <otte@redhat.com>2012-10-01 15:53:17 +0200
commit1e0fe405603b74a88b215defa2a4bcb22495c73f (patch)
tree9b4ac705582fefd4f178e305a0946ef40d03aad6
parentdb374a0a87c2775ded931c707aa4dee4a03ad028 (diff)
downloadgtk+-1e0fe405603b74a88b215defa2a4bcb22495c73f.tar.gz
widget: Move style context update out of vfunc
Otherwise the evil widgets that don't chain up their map and unmap vfuncs will not get updated style contexts. This is in particular true for GtkWindow and the CSS Theming / animated backgrounds demo in gtk-demo.
-rw-r--r--gtk/gtkwidget.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 91aee6c134..c8f8fd51d2 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -4236,6 +4236,9 @@ gtk_widget_map (GtkWidget *widget)
if (!gtk_widget_get_has_window (widget))
gdk_window_invalidate_rect (priv->window, &priv->allocation, FALSE);
+ if (widget->priv->context)
+ _gtk_style_context_update_animating (widget->priv->context);
+
gtk_widget_pop_verify_invariants (widget);
}
}
@@ -4263,6 +4266,10 @@ gtk_widget_unmap (GtkWidget *widget)
if (!gtk_widget_get_has_window (widget))
gdk_window_invalidate_rect (priv->window, &priv->allocation, FALSE);
_gtk_tooltip_hide (widget);
+
+ if (widget->priv->context)
+ _gtk_style_context_update_animating (widget->priv->context);
+
g_signal_emit (widget, widget_signals[UNMAP], 0);
gtk_widget_pop_verify_invariants (widget);
@@ -10368,9 +10375,6 @@ gtk_widget_real_map (GtkWidget *widget)
if (gtk_widget_get_has_window (widget))
gdk_window_show (priv->window);
-
- if (widget->priv->context)
- _gtk_style_context_update_animating (widget->priv->context);
}
}
@@ -10393,9 +10397,6 @@ gtk_widget_real_unmap (GtkWidget *widget)
if (gtk_widget_get_has_window (widget))
gdk_window_hide (priv->window);
-
- if (widget->priv->context)
- _gtk_style_context_update_animating (widget->priv->context);
}
}