[gtk+/wip/csd-for-merge: 4/7] window: Don't set a background pattern/colour when client decorated



commit 475686bfc0aa3810bb3d48de00e6e45f5880ef79
Author: Rob Bradford <rob linux intel com>
Date:   Tue Feb 19 19:26:19 2013 +0000

    window: Don't set a background pattern/colour when client decorated
    
    Otherwise we'll potentially get some background sticking through our rounded
    corners in our decorations. The actual background will get drawn as part of
    the decoration drawing.

 gtk/gtkwindow.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index c060921..637edaf 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5282,7 +5282,11 @@ gtk_window_realize (GtkWidget *widget)
       gtk_widget_set_window (widget, gdk_window);
       gtk_widget_register_window (widget, gdk_window);
 
-      gtk_style_context_set_background (gtk_widget_get_style_context (widget), gdk_window);
+      /* We don't need to set a background on the GdkWindow; with decorations
+       * we draw the background ourself
+       */
+      if (!priv->client_decorated)
+        gtk_style_context_set_background (gtk_widget_get_style_context (widget), gdk_window);
 
       return;
     }
@@ -5360,9 +5364,14 @@ gtk_window_realize (GtkWidget *widget)
 
   gtk_widget_register_window (widget, gdk_window);
 
-  context = gtk_widget_get_style_context (widget);
-  gtk_style_context_set_background (context, gdk_window);
-
+  /* We don't need to set a background on the GdkWindow; with decorations
+   * we draw the background ourself
+   */
+  if (!priv->client_decorated)
+    {
+      context = gtk_widget_get_style_context (widget);
+      gtk_style_context_set_background (context, gdk_window);
+    }
 
   if (priv->transient_parent &&
       gtk_widget_get_realized (GTK_WIDGET (priv->transient_parent)))


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]