From 09979513b2905e29b4cb0fbcfb1b493dd7c01596 Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Thu, 22 Dec 2011 14:44:50 +0000 Subject: [PATCH] window: Stop setting state flags on the style context for drawing This also removes setting the FOCUSED state flag when gtk_window_has_toplevel_focus() since this effect can now be done with the new WINDOW_UNFOCUSED flag instead which actually works better regarding X grabs and modal windows. --- gtk/gtkwindow.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 62e75ee45a..7cf25f9afe 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -7515,26 +7515,18 @@ gtk_window_draw (GtkWidget *widget, context = gtk_widget_get_style_context (widget); - gtk_style_context_save (context); - if (!gtk_widget_get_app_paintable (widget) && gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget))) { - GtkStateFlags state; + gtk_style_context_save (context); - state = gtk_widget_get_state_flags (widget); - - if (gtk_window_has_toplevel_focus (GTK_WINDOW (widget))) - state |= GTK_STATE_FLAG_FOCUSED; - - gtk_style_context_set_state (context, state); gtk_style_context_add_class (context, GTK_STYLE_CLASS_BACKGROUND); gtk_render_background (context, cr, 0, 0, gtk_widget_get_allocated_width (widget), gtk_widget_get_allocated_height (widget)); - } - gtk_style_context_restore (context); + gtk_style_context_restore (context); + } if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw) ret = GTK_WIDGET_CLASS (gtk_window_parent_class)->draw (widget, cr);