From 8dd29d755c7446a1bc8af992c09d0cb61d1e8b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Wed, 21 Jun 2017 17:54:47 +0200 Subject: [PATCH] window: Don't use allocated size in snapshot Those are the wrong values. --- gtk/gtkwindow.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c index 71283398be..a4b1591203 100644 --- a/gtk/gtkwindow.c +++ b/gtk/gtkwindow.c @@ -9040,15 +9040,15 @@ gtk_window_snapshot (GtkWidget *widget, { GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv; GtkStyleContext *context; - GtkAllocation allocation; GtkBorder window_border; gint title_height; GList *l; + int width, height; context = gtk_widget_get_style_context (widget); get_shadow_width (GTK_WINDOW (widget), &window_border); - _gtk_widget_get_allocation (widget, &allocation); + gtk_widget_get_content_size (widget, &width, &height); if (priv->client_decorated && priv->decorated && @@ -9067,26 +9067,24 @@ gtk_window_snapshot (GtkWidget *widget, gtk_snapshot_render_background (snapshot, context, window_border.left - border.left, window_border.top - border.top, - allocation.width - + width - (window_border.left + window_border.right - border.left - border.right), - allocation.height - + height - (window_border.top + window_border.bottom - border.top - border.bottom)); gtk_snapshot_render_frame (snapshot, context, window_border.left - border.left, window_border.top - border.top, - allocation.width - + width - (window_border.left + window_border.right - border.left - border.right), - allocation.height - + height - (window_border.top + window_border.bottom - border.top - border.bottom)); } else { gtk_snapshot_render_background (snapshot, context, 0, 0, - allocation.width, - allocation.height); + width, height); gtk_snapshot_render_frame (snapshot, context, 0, 0, - allocation.width, - allocation.height); + width, height); } gtk_style_context_restore (context); } @@ -9101,16 +9099,16 @@ gtk_window_snapshot (GtkWidget *widget, gtk_snapshot_render_background (snapshot, context, window_border.left, window_border.top + title_height, - allocation.width - + width - (window_border.left + window_border.right), - allocation.height - + height - (window_border.top + window_border.bottom + title_height)); gtk_snapshot_render_frame (snapshot, context, window_border.left, window_border.top + title_height, - allocation.width - + width - (window_border.left + window_border.right), - allocation.height - + height - (window_border.top + window_border.bottom + title_height)); if (priv->title_box != NULL)