[gtk+/transparent-windows] Make window handle transparent



commit 93c086ec80494c5edf84fd6e21c34aec196ea359
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Dec 5 12:51:55 2011 +0100

    Make window handle transparent
    
    Instead of painting the window background on the grip_window we now
    only paint it on the GtkWindow->window, and we make the grip_window
    have a transparent background.
    
    We can't really make transparent window handle background optional
    via css atm, because the handle color is actually based on the
    background color, so if that is set to transparent we won't draw
    anything.

 gtk/gtkwindow.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 50370a5..fd23dd9 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5521,6 +5521,7 @@ resize_grip_create_window (GtkWindow *window)
   GdkWindowAttr attributes;
   gint attributes_mask;
   GdkRectangle rect;
+  GdkRGBA transparent = {0, 0, 0, 0};
 
   priv = window->priv;
   widget = GTK_WIDGET (window);
@@ -5545,6 +5546,7 @@ resize_grip_create_window (GtkWindow *window)
   priv->grip_window = gdk_window_new (gtk_widget_get_window (widget),
                                       &attributes,
                                       attributes_mask);
+  gdk_window_set_background_rgba (priv->grip_window, &transparent);
 
   gdk_window_set_user_data (priv->grip_window, widget);
 
@@ -7440,7 +7442,8 @@ gtk_window_draw (GtkWidget *widget,
 
   gtk_style_context_save (context);
 
-  if (!gtk_widget_get_app_paintable (widget))
+  if (!gtk_widget_get_app_paintable (widget) &&
+      gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
     {
       GtkStateFlags state;
 



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