Module: wine Branch: master Commit: bedb40e5af4c6d858b609a45314c5275763d2002 URL: http://source.winehq.org/git/wine.git/?a=commit;h=bedb40e5af4c6d858b609a4531... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Wed Mar 22 23:11:26 2017 +0100 wined3d: Properly handle back-buffers in surface_translate_drawable_coords(). Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- 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;