[gtk+/gtk-3-18] GtkWindow: draw the frame and shadow even for app-paintable windows



commit e29b91139627ad167630dd6bff906f031d5fb05e
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Tue Oct 20 16:43:06 2015 -0400

    GtkWindow: draw the frame and shadow even for app-paintable windows
    
    If a window is decorated, we need to draw the frame and shadow, even if
    it is app-paintable - it's just nonsense to have a frame that we handle
    events on, but expect the app to paint it. (We paint the titlebar in
    any case.) If a client wants to handle all painting, it should use an
    undecorated window.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756886

 gtk/gtkwindow.c |   38 ++++++++++++++++++++------------------
 1 files changed, 20 insertions(+), 18 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index bc8ba32..2d9f4b5 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -9784,8 +9784,7 @@ gtk_window_draw (GtkWidget *widget,
   get_shadow_width (GTK_WINDOW (widget), &window_border);
   _gtk_widget_get_allocation (widget, &allocation);
 
-  if (!gtk_widget_get_app_paintable (widget) &&
-      gtk_cairo_should_draw_window (cr, _gtk_widget_get_window (widget)))
+  if (gtk_cairo_should_draw_window (cr, _gtk_widget_get_window (widget)))
     {
       if (priv->client_decorated &&
           priv->decorated &&
@@ -9825,14 +9824,24 @@ gtk_window_draw (GtkWidget *widget,
           gtk_style_context_restore (context);
         }
 
-      if (priv->title_box &&
-          gtk_widget_get_visible (priv->title_box) &&
-          gtk_widget_get_child_visible (priv->title_box))
-        title_height = priv->title_height;
-      else
-        title_height = 0;
-
-      gtk_render_background (context, cr,
+      if (!gtk_widget_get_app_paintable (widget))
+        {
+           if (priv->title_box &&
+               gtk_widget_get_visible (priv->title_box) &&
+               gtk_widget_get_child_visible (priv->title_box))
+             title_height = priv->title_height;
+           else
+             title_height = 0;
+
+           gtk_render_background (context, cr,
+                                  window_border.left,
+                                  window_border.top + title_height,
+                                  allocation.width -
+                                  (window_border.left + window_border.right),
+                                  allocation.height -
+                                  (window_border.top + window_border.bottom +
+                                   title_height));
+           gtk_render_frame (context, cr,
                              window_border.left,
                              window_border.top + title_height,
                              allocation.width -
@@ -9840,14 +9849,7 @@ gtk_window_draw (GtkWidget *widget,
                              allocation.height -
                              (window_border.top + window_border.bottom +
                               title_height));
-      gtk_render_frame (context, cr,
-                        window_border.left,
-                        window_border.top + title_height,
-                        allocation.width -
-                        (window_border.left + window_border.right),
-                        allocation.height -
-                        (window_border.top + window_border.bottom +
-                         title_height));
+        }
     }
 
   if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw)


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