diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c index 7b3fb5a289..8e8a3be87a 100644 --- a/gdk/gdkdraw.c +++ b/gdk/gdkdraw.c @@ -623,7 +623,7 @@ gdk_draw_drawable (GdkDrawable *drawable, gint width, gint height) { - GdkDrawable *composite; + GdkDrawable *composite, *composite_impl; gint composite_x_offset = 0; gint composite_y_offset = 0; @@ -652,10 +652,21 @@ gdk_draw_drawable (GdkDrawable *drawable, &composite_x_offset, &composite_y_offset); + /* The draw_drawable call below is will recurse into gdk_draw_drawable again, + * specifying the right impl for the destination. This means the composite + * we got here will be fed to get_composite_drawable again, which is a problem + * for window as that causes double the composite offset. Avoid this by passing + * in the impl directly. + */ + if (GDK_IS_WINDOW (composite)) + composite_impl = GDK_WINDOW_OBJECT (src)->impl; + else + composite_impl = composite; + /* TODO: For non-native windows this may copy stuff from other overlapping windows. We should clip that and clear that area in the destination instead. */ - GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, composite, + GDK_DRAWABLE_GET_CLASS (drawable)->draw_drawable (drawable, gc, composite_impl, xsrc - composite_x_offset, ysrc - composite_y_offset, xdest, ydest, diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c index 4c01723a76..ea5642fe82 100644 --- a/gdk/gdkwindow.c +++ b/gdk/gdkwindow.c @@ -2764,13 +2764,6 @@ gdk_window_draw_drawable (GdkDrawable *drawable, if (GDK_WINDOW_DESTROYED (drawable)) return; - /* By this time the src has been gotten via get_composite_drawable. - If it is a window this implies lots of stuff that we don't want - to do again in the call below. So, we use the impl as the source to - avoid this. */ - if (GDK_IS_WINDOW (src)) - src = GDK_WINDOW_OBJECT (src)->impl; - /* If we have a backing pixmap draw to that */ if (private->paint_stack) {