mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-17 14:30:15 +00:00
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.
This commit is contained in:
parent
db374a0a87
commit
1e0fe40560
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user