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,6 +9821,8 @@ gtk_window_draw (GtkWidget *widget,
gtk_style_context_restore (context); gtk_style_context_restore (context);
} }
if (!gtk_widget_get_app_paintable (widget))
{
if (priv->title_box && if (priv->title_box &&
gtk_widget_get_visible (priv->title_box) && gtk_widget_get_visible (priv->title_box) &&
gtk_widget_get_child_visible (priv->title_box)) gtk_widget_get_child_visible (priv->title_box))
@ -9846,6 +9847,7 @@ gtk_window_draw (GtkWidget *widget,
(window_border.top + window_border.bottom + (window_border.top + window_border.bottom +
title_height)); title_height));
} }
}
if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw) if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw)
ret = GTK_WIDGET_CLASS (gtk_window_parent_class)->draw (widget, cr); ret = GTK_WIDGET_CLASS (gtk_window_parent_class)->draw (widget, cr);