Commit 868974c6 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

winex11.drv: Don't modify state if glXMakeContextCurrent fails.

parent 8818c1d8
......@@ -1977,11 +1977,14 @@ BOOL CDECL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* pDrawDev, X11DRV_PDEV
if (NULL == pglXMakeContextCurrent) {
ret = FALSE;
} else {
Wine_GLContext *prev_ctx = NtCurrentTeb()->glContext;
Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
Drawable d_draw = get_glxdrawable(pDrawDev);
Drawable d_read = get_glxdrawable(pReadDev);
ret = pglXMakeContextCurrent(gdi_display, d_draw, d_read, ctx->ctx);
if (ret)
{
Wine_GLContext *prev_ctx = NtCurrentTeb()->glContext;
if (prev_ctx) prev_ctx->tid = 0;
ctx->has_been_current = TRUE;
......@@ -1991,9 +1994,11 @@ BOOL CDECL X11DRV_wglMakeContextCurrentARB(X11DRV_PDEVICE* pDrawDev, X11DRV_PDEV
ctx->drawables[0] = d_draw;
ctx->drawables[1] = d_read;
ctx->refresh_drawables = FALSE;
ret = pglXMakeContextCurrent(gdi_display, d_draw, d_read, ctx->ctx);
NtCurrentTeb()->glContext = ctx;
}
else
SetLastError(ERROR_INVALID_HANDLE);
}
}
wine_tsx11_unlock();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment