From 9bc0ea54660d3cc3448cd947d9ec33093c7f650b Mon Sep 17 00:00:00 2001 From: Michael Natterer Date: Sat, 20 Feb 2010 11:05:37 +0100 Subject: [PATCH] app: don't leave artifacts on the box when a child changes its size gimp_overlay_child_size_allocate(): invalidate the child's old area before moving its window around. --- app/widgets/gimpoverlaychild.c | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/app/widgets/gimpoverlaychild.c b/app/widgets/gimpoverlaychild.c index a198fe2587..c7bbb21905 100644 --- a/app/widgets/gimpoverlaychild.c +++ b/app/widgets/gimpoverlaychild.c @@ -236,11 +236,28 @@ gimp_overlay_child_size_allocate (GimpOverlayBox *box, gtk_widget_get_allocation (child->widget, &child_allocation); if (GTK_WIDGET_REALIZED (widget)) - gdk_window_move_resize (child->window, - child_allocation.x, - child_allocation.y, - child_allocation.width, - child_allocation.height); + { + GdkRectangle old_allocation; + GdkRectangle old_bounds; + + gdk_window_get_position (child->window, + &old_allocation.x, + &old_allocation.y); + gdk_drawable_get_size (child->window, + &old_allocation.width, + &old_allocation.height); + + gimp_overlay_child_transform_bounds (child, &old_allocation, &old_bounds); + + gdk_window_invalidate_rect (gtk_widget_get_window (widget), + &old_bounds, FALSE); + + gdk_window_move_resize (child->window, + child_allocation.x, + child_allocation.y, + child_allocation.width, + child_allocation.height); + } cairo_matrix_init_identity (&child->matrix);