Index: dlls/opengl32/wgl.c =================================================================== RCS file: /home/wine/wine/dlls/opengl32/wgl.c,v retrieving revision 1.48 diff -u -r1.48 wgl.c --- dlls/opengl32/wgl.c 25 Feb 2004 01:25:49 -0000 1.48 +++ dlls/opengl32/wgl.c 7 Apr 2004 20:50:34 -0000 @@ -414,6 +414,8 @@ /*********************************************************************** * wglMakeCurrent (OPENGL32.@) */ +static HGLRC current_context; + BOOL WINAPI wglMakeCurrent(HDC hdc, HGLRC hglrc) { BOOL ret; @@ -422,6 +424,12 @@ ENTER_GL(); if (hglrc == NULL) { + if (current_context != NULL) { + /* At least, when putting all three of them, I will be sure to handle all cases :-) */ + glXWaitGL(); + glXWaitX(); + glFinish(); + } ret = glXMakeCurrent(default_display, None, NULL); } else { Wine_GLContext *ctx = (Wine_GLContext *) hglrc; @@ -433,6 +441,9 @@ } ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx); } + + current_context = hglrc; + LEAVE_GL(); TRACE(" returning %s\n", (ret ? "True" : "False")); return ret;