[gtk+] window: Stop setting state flags on the style context for drawing
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] window: Stop setting state flags on the style context for drawing
- Date: Mon, 9 Jan 2012 16:57:12 +0000 (UTC)
commit 09979513b2905e29b4cb0fbcfb1b493dd7c01596
Author: Rui Matos <tiagomatos gmail com>
Date: Thu Dec 22 14:44:50 2011 +0000
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 files changed, 3 insertions(+), 11 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 62e75ee..7cf25f9 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;
-
- state = gtk_widget_get_state_flags (widget);
-
- if (gtk_window_has_toplevel_focus (GTK_WINDOW (widget)))
- state |= GTK_STATE_FLAG_FOCUSED;
+ gtk_style_context_save (context);
- 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]