mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-09-29 02:27:53 +00:00
gtkstylecontext: Add an optional warning when misusing GtkStyleContext
This allows someone to quickly debug more performance issues with G_DEBUG=fatal-warnings.
This commit is contained in:
parent
d21dc0d91c
commit
eba317228f
@ -745,6 +745,9 @@ style_values_lookup_for_state (GtkStyleContext *context,
|
||||
if (gtk_css_node_declaration_get_state (context->priv->info->decl) == state)
|
||||
return g_object_ref (style_values_lookup (context));
|
||||
|
||||
if (g_getenv ("GTK_STYLE_CONTEXT_WARNING"))
|
||||
g_warning ("State does not match current state");
|
||||
|
||||
decl = gtk_css_node_declaration_ref (context->priv->info->decl);
|
||||
gtk_css_node_declaration_set_state (&decl, state);
|
||||
values = _gtk_css_computed_values_new ();
|
||||
|
Loading…
Reference in New Issue
Block a user