From b4d2708dbae8708fe4e50b2fb4d823c20d9d829a Mon Sep 17 00:00:00 2001 From: raveit65 Date: Sun, 28 Feb 2016 10:38:41 +0100 Subject: GTK+3: Get values from GtkStyleContext states properly this avoids warnings like this: Warning of Windowmanagement:Log level 16: State 4 for context 0x55988f9ad950 doesn't match state 128 set via gtk_style_context_set_state () --- src/ui/ui.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/ui/ui.c') diff --git a/src/ui/ui.c b/src/ui/ui.c index 76ef72fa..53f374de 100644 --- a/src/ui/ui.c +++ b/src/ui/ui.c @@ -849,7 +849,14 @@ meta_ui_theme_get_frame_borders (MetaUI *ui, gtk_style_context_set_path (style, widget_path); gtk_widget_path_free (widget_path); - gtk_style_context_get (style, GTK_STATE_FLAG_NORMAL, "font", &free_font_desc, NULL); + gtk_style_context_save (style); + gtk_style_context_set_state (style, GTK_STATE_FLAG_NORMAL); + gtk_style_context_get (style, + gtk_style_context_get_state (style), + "font", + &free_font_desc, + NULL); + gtk_style_context_restore (context); font_desc = (const PangoFontDescription *) free_font_desc; #else GtkStyle *default_style; -- cgit v1.2.1