summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnode.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-01-15 19:19:38 -0500
committerMatthias Clasen <mclasen@redhat.com>2020-01-16 11:23:25 -0500
commit64848aebf48793544c81e825959985783825b914 (patch)
tree8e3901888afb2421e56ad772cd7c504d79571df7 /gtk/gtkcssnode.c
parentfcceac6d118354ac3e73cd80c4dab8d026e49721 (diff)
downloadgtk+-64848aebf48793544c81e825959985783825b914.tar.gz
css: Track disabled state separately
Significantly reduces the number of nodes that react to parent-state changes. Before (numbers from widget-factory with Adwaita): 2247 nodes class 612 name 2246 id 2 first-child 148 last-child 156 state 2247 hover 2247 sibling-name 63 sibling-state 51 parent-class 586 parent-name 788 parent-id 2 parent-first-child 78 parent-last-child 78 parent-state 2226 parent-hover 5 After: 2247 nodes class 612 name 2246 id 2 first-child 148 last-child 156 state 2247 hover 562 disabled 859 sibling-name 63 sibling-disabled 51 parent-class 586 parent-name 788 parent-id 2 parent-first-child 78 parent-last-child 78 parent-state 236 parent-hover 5 parent-disabled 91
Diffstat (limited to 'gtk/gtkcssnode.c')
-rw-r--r--gtk/gtkcssnode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkcssnode.c b/gtk/gtkcssnode.c
index cdc72d1881..0f65796729 100644
--- a/gtk/gtkcssnode.c
+++ b/gtk/gtkcssnode.c
@@ -1149,7 +1149,10 @@ gtk_css_node_set_state (GtkCssNode *cssnode,
if (states & GTK_STATE_FLAG_PRELIGHT)
change |= GTK_CSS_CHANGE_HOVER;
- if (states & ~GTK_STATE_FLAG_PRELIGHT)
+ if (states & GTK_STATE_FLAG_INSENSITIVE)
+ change |= GTK_CSS_CHANGE_DISABLED;
+ if (states & ~(GTK_STATE_FLAG_PRELIGHT |
+ GTK_STATE_FLAG_INSENSITIVE))
change |= GTK_CSS_CHANGE_STATE;
gtk_css_node_invalidate (cssnode, change);