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
This commit is contained in:
Owen W. Taylor 2015-10-20 16:43:06 -04:00
parent 01136618b8
commit 1571d2872f

View File

@ -9783,8 +9783,7 @@ gtk_window_draw (GtkWidget *widget,
get_shadow_width (GTK_WINDOW (widget), &window_border); get_shadow_width (GTK_WINDOW (widget), &window_border);
_gtk_widget_get_allocation (widget, &allocation); _gtk_widget_get_allocation (widget, &allocation);
if (!gtk_widget_get_app_paintable (widget) && if (gtk_cairo_should_draw_window (cr, _gtk_widget_get_window (widget)))
gtk_cairo_should_draw_window (cr, _gtk_widget_get_window (widget)))
{ {
if (priv->client_decorated && if (priv->client_decorated &&
priv->decorated && priv->decorated &&
@ -9822,14 +9821,24 @@ gtk_window_draw (GtkWidget *widget,
gtk_style_context_restore (context); gtk_style_context_restore (context);
} }
if (priv->title_box && if (!gtk_widget_get_app_paintable (widget))
gtk_widget_get_visible (priv->title_box) && {
gtk_widget_get_child_visible (priv->title_box)) if (priv->title_box &&
title_height = priv->title_height; gtk_widget_get_visible (priv->title_box) &&
else gtk_widget_get_child_visible (priv->title_box))
title_height = 0; title_height = priv->title_height;
else
title_height = 0;
gtk_render_background (context, cr, 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.left,
window_border.top + title_height, window_border.top + title_height,
allocation.width - allocation.width -
@ -9837,14 +9846,7 @@ gtk_window_draw (GtkWidget *widget,
allocation.height - allocation.height -
(window_border.top + window_border.bottom + (window_border.top + window_border.bottom +
title_height)); 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) if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw)