From: Henri Verbeet Subject: [PATCH 2/5] wined3d: Properly handle back-buffers in surface_translate_drawable_coords(). Message-Id: <1490220689-5842-2-git-send-email-hverbeet@codeweavers.com> Date: Wed, 22 Mar 2017 23:11:26 +0100 Signed-off-by: Henri Verbeet --- dlls/wined3d/surface.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index 94ec035..2a3fbc9 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -2078,13 +2078,16 @@ void surface_translate_drawable_coords(const struct wined3d_surface *surface, HW struct wined3d_texture *texture = surface->container; UINT drawable_height; - if (texture->swapchain && texture == texture->swapchain->front_buffer) + if (texture->swapchain) { POINT offset = {0, 0}; RECT windowsize; - ScreenToClient(window, &offset); - OffsetRect(rect, offset.x, offset.y); + if (texture == texture->swapchain->front_buffer) + { + ScreenToClient(window, &offset); + OffsetRect(rect, offset.x, offset.y); + } GetClientRect(window, &windowsize); drawable_height = windowsize.bottom - windowsize.top; -- 2.1.4