diff --git a/src/context.c b/src/context.c index 2ec29c25..fa1a4d78 100644 --- a/src/context.c +++ b/src/context.c @@ -778,6 +778,9 @@ GLFWAPI void glfwDestroyUserContext(GLFWusercontext* handle) GLFWAPI void glfwMakeUserContextCurrent(GLFWusercontext* handle) { _GLFWusercontext* context = (_GLFWusercontext*)handle; + + glfwMakeContextCurrent(NULL); + if (context) context->makeCurrent(context); } diff --git a/tests/usercontext.c b/tests/usercontext.c index 58916430..a3182929 100644 --- a/tests/usercontext.c +++ b/tests/usercontext.c @@ -31,11 +31,9 @@ int main(void) } /* set the user context current */ - glfwMakeContextCurrent(NULL); glfwMakeUserContextCurrent(usercontext); /* set the window context current */ - glfwMakeUserContextCurrent(NULL); glfwMakeContextCurrent(window); glClearColor( 0.4f, 0.3f, 0.4f, 0.0f );