wined3d: Make sure we are still using the correct window before setting pixel format.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-07-18 10:03:51 +02:00
parent 977f8cc64d
commit 548382e634
1 changed files with 3 additions and 0 deletions

View File

@ -1102,6 +1102,9 @@ static BOOL context_set_pixel_format(struct wined3d_context *context, HDC dc, BO
if (dc == context->hdc && context->hdc_is_private && context->hdc_has_format) if (dc == context->hdc && context->hdc_is_private && context->hdc_has_format)
return TRUE; return TRUE;
if (dc == context->hdc && !context->hdc_is_private && WindowFromDC(dc) != context->win_handle)
return FALSE;
current = gl_info->gl_ops.wgl.p_wglGetPixelFormat(dc); current = gl_info->gl_ops.wgl.p_wglGetPixelFormat(dc);
if (current == format) goto success; if (current == format) goto success;