[gimp] app: don't leave artifacts on the box when a child changes its size



commit 9bc0ea54660d3cc3448cd947d9ec33093c7f650b
Author: Michael Natterer <mitch gimp org>
Date:   Sat Feb 20 11:05:37 2010 +0100

    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 files changed, 22 insertions(+), 5 deletions(-)
---
diff --git a/app/widgets/gimpoverlaychild.c b/app/widgets/gimpoverlaychild.c
index a198fe2..c7bbb21 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);
 



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