From 4d2c03539d7316d75b56fd8a2c852a9013234f0c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
Date: Sun, 28 Sep 2014 21:20:52 +0200
Subject: winex11.drv: Only warn about used contexts in wglShareLists.

---
 dlls/opengl32/tests/opengl.c |  2 +-
 dlls/winex11.drv/opengl.c    | 10 ++++------
 2 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/dlls/opengl32/tests/opengl.c b/dlls/opengl32/tests/opengl.c
index e5e1507..5454d3a 100644
--- a/dlls/opengl32/tests/opengl.c
+++ b/dlls/opengl32/tests/opengl.c
@@ -365,7 +365,7 @@ static void test_sharelists(HDC winhdc)
         res = wglMakeCurrent(winhdc, hglrc2);
         ok(res, "Make current failed\n");
         res = wglShareLists(hglrc1, hglrc2);
-        todo_wine ok(res, "Sharing display lists with a destination context which has been made current failed\n");
+        ok(res, "Sharing display lists with a destination context which has been made current failed\n");
         wglMakeCurrent(0, 0);
         wglDeleteContext(hglrc2);
     }
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 0f7534e..39929f2 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1959,18 +1959,16 @@ static BOOL glxdrv_wglShareLists(struct wgl_context *org, struct wgl_context *de
      * current or when it hasn't shared display lists before.
      */
 
-    if((org->has_been_current && dest->has_been_current) || dest->has_been_current)
-    {
-        ERR("Could not share display lists, one of the contexts has been current already !\n");
-        return FALSE;
-    }
-    else if(dest->sharing)
+    if(dest->sharing)
     {
         ERR("Could not share display lists because hglrc2 has already shared lists before\n");
         return FALSE;
     }
     else
     {
+        if(dest->has_been_current)
+            ERR("Recreating OpenGL context to share display lists, although the context has been current!\n");
+
         /* Re-create the GLX context and share display lists */
         pglXDestroyContext(gdi_display, dest->ctx);
         dest->ctx = create_glxcontext(gdi_display, dest, org->ctx);
-- 
2.8.0

