[gtk+/wip/window-unfocused-fixes: 4/13] viewport: Set state flags on draw
- From: Rui Matos <rtcm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/window-unfocused-fixes: 4/13] viewport: Set state flags on draw
- Date: Tue, 13 Dec 2011 21:03:30 +0000 (UTC)
commit 81fbced2d87ce4368c1779560e22cd600af2a2e2
Author: Rui Matos <tiagomatos gmail com>
Date: Sun Dec 11 23:06:11 2011 +0000
viewport: Set state flags on draw
https://bugzilla.gnome.org/show_bug.cgi?id=666126
gtk/gtkviewport.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index 048d0f6..8d4ebf4 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -746,13 +746,16 @@ gtk_viewport_draw (GtkWidget *widget,
GtkViewport *viewport = GTK_VIEWPORT (widget);
GtkViewportPrivate *priv = viewport->priv;
GtkStyleContext *context;
+ GtkStateFlags state;
int x, y;
context = gtk_widget_get_style_context (widget);
+ state = gtk_widget_get_state_flags (widget);
if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
{
gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state);
gtk_style_context_add_class (context, GTK_STYLE_CLASS_FRAME);
gtk_render_frame (context, cr, 0, 0,
@@ -779,11 +782,16 @@ gtk_viewport_draw (GtkWidget *widget,
if (gtk_cairo_should_draw_window (cr, priv->bin_window))
{
+ gtk_style_context_save (context);
+ gtk_style_context_set_state (context, state);
+
gdk_window_get_position (priv->bin_window, &x, &y);
gtk_render_background (context, cr, x, y,
gdk_window_get_width (priv->bin_window),
gdk_window_get_height (priv->bin_window));
+ gtk_style_context_restore (context);
+
GTK_WIDGET_CLASS (gtk_viewport_parent_class)->draw (widget, cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]