[gtk+] stylecontext: Don't emit state warning for transient nodes
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] stylecontext: Don't emit state warning for transient nodes
- Date: Tue, 1 Dec 2015 23:32:05 +0000 (UTC)
commit 8355ee3053d24c5b5bf39f588ddade83cc96da7e
Author: Benjamin Otte <otte redhat com>
Date: Wed Dec 2 00:26:16 2015 +0100
stylecontext: Don't emit state warning for transient nodes
It's fine to call set_state() on those.
https://bugzilla.gnome.org/show_bug.cgi?id=758930
gtk/gtkstylecontext.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index 4a5c343..dbaa4d0 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -499,7 +499,11 @@ gtk_style_context_push_state (GtkStyleContext *context,
root = gtk_style_context_get_root (context);
- if (GTK_IS_CSS_WIDGET_NODE (root))
+ if (GTK_IS_CSS_TRANSIENT_NODE (priv->cssnode))
+ {
+ /* don't emit a warning, changing state here is fine */
+ }
+ else if (GTK_IS_CSS_WIDGET_NODE (root))
{
GtkWidget *widget = gtk_css_widget_node_get_widget (GTK_CSS_WIDGET_NODE (root));
g_warning ("State %u for %s %p doesn't match state %u set via gtk_style_context_set_state ()",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]