From a4e86341e4a6f1ecc1d996c592df10ef1ed131fd Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 7 Sep 2015 11:39:55 +0200 Subject: [PATCH] notebook: Set active state properly Don't update it on save/restore, actually set it when it changes. --- gtk/gtknotebook.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 5be91364cd..bc45bedfc6 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -2033,8 +2033,6 @@ notebook_save_context_for_tab (GtkNotebook *notebook, if (page != NULL) { - if (page == notebook->priv->cur_page) - state |= GTK_STATE_FLAG_ACTIVE; if (page->reorderable) gtk_style_context_add_class (context, "reorderable-page"); } @@ -6743,12 +6741,16 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook, if (priv->cur_page) { gtk_widget_set_child_visible (priv->cur_page->child, FALSE); + gtk_css_node_set_state (priv->cur_page->cssnode, + gtk_css_node_get_state (priv->cur_page->cssnode) & ~GTK_STATE_FLAG_ACTIVE); if (priv->cur_page->tab_label) gtk_style_context_remove_class (gtk_widget_get_style_context (priv->cur_page->tab_label), "active-page"); } priv->cur_page = page; + gtk_css_node_set_state (page->cssnode, + gtk_css_node_get_state (page->cssnode) | GTK_STATE_FLAG_ACTIVE); if (page->tab_label) gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label), "active-page");