[gtk+] widget: Move style context update out of vfunc
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] widget: Move style context update out of vfunc
- Date: Mon, 1 Oct 2012 13:53:35 +0000 (UTC)
commit 1e0fe405603b74a88b215defa2a4bcb22495c73f
Author: Benjamin Otte <otte redhat com>
Date: Mon Oct 1 15:43:21 2012 +0200
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.
gtk/gtkwidget.c | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 91aee6c..c8f8fd5 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);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]