diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h index 75eb068856..a668e682bc 100644 --- a/gdk/gdkinternals.h +++ b/gdk/gdkinternals.h @@ -605,7 +605,7 @@ void _gdk_display_enable_motion_hints (GdkDisplay *display); void _gdk_window_invalidate_for_expose (GdkWindow *window, - const GdkRegion *region); + GdkRegion *region); void _gdk_windowing_set_cairo_surface_size (cairo_surface_t *surface, int width, diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index cfb9d9edc9..04d8010061 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -5300,8 +5300,37 @@ gdk_window_invalidate_region (GdkWindow *window, **/ void _gdk_window_invalidate_for_expose (GdkWindow *window, - const GdkRegion *region) + GdkRegion *region) { + GdkWindowObject *private = (GdkWindowObject *) window; + GdkWindowRegionMove *move; + GdkRegion *move_region; + GList *l; + + /* Any invalidations comming from the windowing system will + be in areas that may be moved by outstanding moves, + so we need to modify the expose region correspondingly, + otherwise we would expose in the wrong place, as the + outstanding moves will be copied before we draw the + exposes. */ + for (l = private->outstanding_moves; l != NULL; l = l->next) + { + move = l->data; + + /* covert to move source region */ + move_region = gdk_region_copy (move->dest_region); + gdk_region_offset (move_region, -move->dx, -move->dy); + + /* Move area of region that intersects with move source + by dx, dy of the move*/ + gdk_region_intersect (move_region, region); + gdk_region_subtract (region, move_region); + gdk_region_offset (move_region, move->dx, move->dy); + gdk_region_union (region, move_region); + + gdk_region_destroy (move_region); + } + gdk_window_invalidate_maybe_recurse (window, region, (gboolean (*) (GdkWindow *, gpointer))gdk_window_has_no_impl, NULL);