diff --git a/dlls/opengl32/wgl.c b/dlls/opengl32/wgl.c
index c7d3147..fe9eb77 100644
--- a/dlls/opengl32/wgl.c
+++ b/dlls/opengl32/wgl.c
@@ -69,8 +69,9 @@ enum x11drv_escape_codes
 void (*wine_tsx11_lock_ptr)(void) = NULL;
 void (*wine_tsx11_unlock_ptr)(void) = NULL;
 
+static Display*   default_display;  /* display to use for default context */
 static GLXContext default_cx = NULL;
-static Display *default_display;  /* display to use for default context */
+static GLXWindow  gl_window = NULL;
 
 static HMODULE opengl32_handle;
 
@@ -91,6 +92,18 @@ typedef struct wine_glcontext {
 } Wine_GLContext;
 static Wine_GLContext *context_list;
 
+static XVisualInfo* GetDisplayVisualInfo(Display *display)
+{
+  int num;
+  XVisualInfo template;
+  XVisualInfo *vis = NULL;
+  VisualID visualid = (VisualID)GetPropA( GetDesktopWindow(), "__wine_x11_visual_id" );
+  template.visualid = visualid;
+  vis = XGetVisualInfo(display, VisualIDMask, &template, &num);
+  return vis;
+}
+
+
 static inline Wine_GLContext *get_context_from_GLXContext(GLXContext ctx)
 {
     Wine_GLContext *ret;
@@ -187,6 +200,117 @@ inline static Font get_font( HDC hdc )
     return font;
 }
 
+static int describeContext(Wine_GLContext* ctx) {
+  int tmp;
+  int ctx_vis_id;
+  TRACE(" Context %p have (vis:%p):\n", ctx, ctx->vis);
+  wine_glx.p_glXGetFBConfigAttrib(ctx->display, ctx->fb_conf, GLX_FBCONFIG_ID, &tmp);
+  TRACE(" - FBCONFIG_ID 0x%x\n", tmp);
+  wine_glx.p_glXGetFBConfigAttrib(ctx->display, ctx->fb_conf, GLX_VISUAL_ID, &tmp);
+  TRACE(" - VISUAL_ID 0x%x\n", tmp);
+  ctx_vis_id = tmp;
+  return ctx_vis_id;
+}
+
+static int describeDrawable(Display* display, Drawable drawable) {
+  int tmp;
+  int draw_vis_id;
+  if (3 > wine_glx.version || NULL == wine_glx.p_glXQueryDrawable)  {
+    /** glXQueryDrawable not available so returns not supported */
+    return -1;
+  }
+  TRACE(" Drawable %p have :\n", (void*) drawable);
+  wine_glx.p_glXQueryDrawable(display, drawable, GLX_FBCONFIG_ID, (unsigned int*) &tmp);
+  TRACE(" - FBCONFIG_ID as 0x%x\n", tmp);
+  wine_glx.p_glXQueryDrawable(display, drawable, GLX_VISUAL_ID, (unsigned int*) &tmp);
+  TRACE(" - VISUAL_ID as 0x%x\n", tmp);
+  draw_vis_id = tmp;
+  wine_glx.p_glXQueryDrawable(display, drawable, GLX_WIDTH, (unsigned int*) &tmp);
+  TRACE(" - WIDTH as %d\n", tmp);
+  wine_glx.p_glXQueryDrawable(display, drawable, GLX_HEIGHT, (unsigned int*) &tmp);
+  TRACE(" - HEIGHT as %d\n", tmp);
+  return draw_vis_id;
+}
+
+static Wine_GLContext* GetWineDelayedContext(Wine_GLContext* ctx, HDC hdc, Wine_GLContext* ctx_share)
+{
+  DWORD type = GetObjectType(hdc);
+  Drawable drawable = get_drawable( hdc );
+
+  Window root = (Window)GetPropA( GetDesktopWindow(), "__wine_x11_whole_window" );
+  if (drawable == root) {
+    WARN("hdc == Desktop()\n");
+  }
+  if (type == OBJ_MEMDC) {
+    WARN("type == OBJ_MEMDC\n");
+  }
+  WARN("-> root(%p) hdc(%p) \n", root, drawable);
+
+  if (ctx->ctx == NULL) {
+    int new = 0;
+
+    if (NULL == gl_window) {
+      /*
+      Window root = (Window)GetPropA( GetDesktopWindow(), "__wine_x11_whole_window" );
+      gl_window = glXCreateWindow(ctx->display, ctx->fb_conf, root, NULL); 
+      WARN("GL Window as %p\n", gl_window);
+      */
+      //glXMakeCurrent(ctx->display, gl_window, NULL);
+      /*      
+      Window root = (Window)GetPropA( GetDesktopWindow(), "__wine_x11_whole_window" );
+      gl_window = glXCreateWindow(ctx->display, ctx->fb_conf, root, NULL); 
+#if 0
+      default_cx = glXCreateNewContext(ctx->display, ctx->fb_conf,  GLX_RGBA_TYPE, 0, GL_FALSE);
+      gl_window = glXCreateWindow(ctx->display, ctx->fb_conf, root, NULL); 
+      glXMakeContextCurrent(ctx->display, gl_window, gl_window, default_cx);
+#endif
+      */
+    }
+
+    GLXContext share = NULL;
+    if (NULL != ctx_share) {
+      share = ctx_share->ctx;
+    }
+
+    int draw_vis_id, ctx_vis_id;
+    
+    XVisualInfo* vis = GetDisplayVisualInfo(ctx->display);
+    TRACE(" Wine desktop VISUAL_ID is 0x%x (%p)\n", (unsigned int) vis->visualid, vis);
+
+    ctx_vis_id = describeContext(ctx);
+#if 0
+    draw_vis_id = describeDrawable(ctx->display, drawable);
+    if (-1 == draw_vis_id || (draw_vis_id == vis->visualid && draw_vis_id != ctx_vis_id)) {
+      /**
+       * Inherits from root window so reuse desktop visual
+       */
+      TRACE(" Creating GLX Context (based on root)\n");
+      ctx->ctx = glXCreateContext(ctx->display, vis, share, type == OBJ_MEMDC ? False : True);
+    } else {
+      TRACE(" Creating GLX Context\n");
+      ctx->ctx = glXCreateContext(ctx->display, ctx->vis, share, type == OBJ_MEMDC ? False : True);
+    }
+#else
+    TRACE(" Creating GLX Context\n");
+    ctx->ctx = glXCreateContext(ctx->display, vis, share, type == OBJ_MEMDC ? GL_FALSE : GL_TRUE);
+    //ctx->ctx = glXCreateContext(ctx->display, ctx->vis, share, type == OBJ_MEMDC ? GL_FALSE : GL_TRUE);
+    //ctx->ctx = glXCreateNewContext(ctx->display, ctx->fb_conf, GLX_RGBA_TYPE, share, type == OBJ_MEMDC ? GL_FALSE : GL_TRUE);
+#endif
+
+    TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
+    /*
+    if (NULL == gl_window) {
+      Window root = (Window)GetPropA( GetDesktopWindow(), "__wine_x11_whole_window" );
+      gl_window = glXCreateWindow(ctx->display, ctx->fb_conf, root, NULL); 
+      glXMakeContextCurrent(ctx->display, gl_window, gl_window, ctx->ctx);
+    }
+    */
+
+  }
+  return ctx;
+}
+
+
 
 /***********************************************************************
  *		wglCreateContext (OPENGL32.@)
@@ -194,8 +318,6 @@ inline static Font get_font( HDC hdc )
 HGLRC WINAPI wglCreateContext(HDC hdc)
 {
   Wine_GLContext *ret;
-  int num;
-  XVisualInfo template;
   XVisualInfo *vis = NULL;
   Display *display = get_display( hdc );
   int hdcPF = GetPixelFormat(hdc);
@@ -205,8 +327,7 @@ HGLRC WINAPI wglCreateContext(HDC hdc)
 
   /* First, get the visual in use by the X11DRV */
   if (!display) return 0;
-  template.visualid = (VisualID)GetPropA( GetDesktopWindow(), "__wine_x11_visual_id" );
-  vis = XGetVisualInfo(display, VisualIDMask, &template, &num);
+  vis = GetDisplayVisualInfo(display);
 
   if (vis == NULL) {
     ERR("NULL visual !!!\n");
@@ -495,38 +616,6 @@ PROC WINAPI wglGetProcAddress(LPCSTR  lp
   }
 }
 
-static int describeContext(Wine_GLContext* ctx) {
-  int tmp;
-  int ctx_vis_id;
-  TRACE(" Context %p have (vis:%p):\n", ctx, ctx->vis);
-  wine_glx.p_glXGetFBConfigAttrib(ctx->display, ctx->fb_conf, GLX_FBCONFIG_ID, &tmp);
-  TRACE(" - FBCONFIG_ID 0x%x\n", tmp);
-  wine_glx.p_glXGetFBConfigAttrib(ctx->display, ctx->fb_conf, GLX_VISUAL_ID, &tmp);
-  TRACE(" - VISUAL_ID 0x%x\n", tmp);
-  ctx_vis_id = tmp;
-  return ctx_vis_id;
-}
-
-static int describeDrawable(Wine_GLContext* ctx, Drawable drawable) {
-  int tmp;
-  int draw_vis_id;
-  if (3 > wine_glx.version || NULL == wine_glx.p_glXQueryDrawable)  {
-    /** glXQueryDrawable not available so returns not supported */
-    return -1;
-  }
-  TRACE(" Drawable %p have :\n", (void*) drawable);
-  wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_FBCONFIG_ID, (unsigned int*) &tmp);
-  TRACE(" - FBCONFIG_ID as 0x%x\n", tmp);
-  wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_VISUAL_ID, (unsigned int*) &tmp);
-  TRACE(" - VISUAL_ID as 0x%x\n", tmp);
-  draw_vis_id = tmp;
-  wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_WIDTH, (unsigned int*) &tmp);
-  TRACE(" - WIDTH as %d\n", tmp);
-  wine_glx.p_glXQueryDrawable(ctx->display, drawable, GLX_HEIGHT, (unsigned int*) &tmp);
-  TRACE(" - HEIGHT as %d\n", tmp);
-  return draw_vis_id;
-}
-
 /***********************************************************************
  *		wglMakeCurrent (OPENGL32.@)
  */
@@ -544,23 +633,20 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
   } else {
       Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
       Drawable drawable = get_drawable( hdc );
+      /*
       if (ctx->ctx == NULL) {
 	int draw_vis_id, ctx_vis_id;
-        VisualID visualid = (VisualID)GetPropA( GetDesktopWindow(), "__wine_x11_visual_id" );
-	TRACE(" Wine desktop VISUAL_ID is 0x%x\n", (unsigned int) visualid);
-	draw_vis_id = describeDrawable(ctx, drawable);
+
+	XVisualInfo* vis = GetDisplayVisualInfo(ctx->display);
+	TRACE(" Wine desktop VISUAL_ID is 0x%x (%p)\n", (unsigned int) vis->visualid, vis);
+
+	draw_vis_id = describeDrawable(ctx->display, drawable);
 	ctx_vis_id = describeContext(ctx);
 
-	if (-1 == draw_vis_id || (draw_vis_id == visualid && draw_vis_id != ctx_vis_id)) {
-	  /**
+	if (-1 == draw_vis_id || (draw_vis_id == vis->visualid && draw_vis_id != ctx_vis_id)) {
+	  / **
 	   * Inherits from root window so reuse desktop visual
-	   */
-	  XVisualInfo template;
-	  XVisualInfo *vis;
-	  int num;
-	  template.visualid = visualid;
-	  vis = XGetVisualInfo(ctx->display, VisualIDMask, &template, &num);
-
+	   * /
 	  TRACE(" Creating GLX Context\n");
 	  ctx->ctx = glXCreateContext(ctx->display, vis, NULL, type == OBJ_MEMDC ? False : True);
 	} else {
@@ -569,6 +655,8 @@ BOOL WINAPI wglMakeCurrent(HDC hdc,
 	}
 	TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
       }
+      */
+      ctx = GetWineDelayedContext(ctx, hdc, NULL);
       TRACE(" make current for dis %p, drawable %p, ctx %p\n", ctx->display, (void*) drawable, ctx->ctx);
       ret = glXMakeCurrent(ctx->display, drawable, ctx->ctx);
       NtCurrentTeb()->glContext = ctx;
@@ -601,11 +689,14 @@ BOOL WINAPI wglMakeContextCurrentARB(HDC
       Wine_GLContext *ctx = (Wine_GLContext *) hglrc;
       Drawable d_draw = get_drawable( hDrawDC );
       Drawable d_read = get_drawable( hReadDC );
-      
+
+      ctx = GetWineDelayedContext(ctx, hDrawDC, NULL); 
+      /*
       if (ctx->ctx == NULL) {
         ctx->ctx = glXCreateContext(ctx->display, ctx->vis, NULL, GetObjectType(hDrawDC) == OBJ_MEMDC ? False : True);
         TRACE(" created a delayed OpenGL context (%p)\n", ctx->ctx);
       }
+      */
       ret = wine_glx.p_glXMakeContextCurrent(ctx->display, d_draw, d_read, ctx->ctx);
     }
   }
@@ -676,16 +767,22 @@ BOOL WINAPI wglShareLists(HGLRC hglrc1,
   } else {
     if (org->ctx == NULL) {
       ENTER_GL();
+      /*
       describeContext(org);
       org->ctx = glXCreateContext(org->display, org->vis, NULL, GetObjectType(org->hdc) == OBJ_MEMDC ? False : True);
+      */
+      org = GetWineDelayedContext(org, org->hdc, NULL);
       LEAVE_GL();
       TRACE(" created a delayed OpenGL context (%p) for Wine context %p\n", org->ctx, org);
     }
     if (NULL != dest) {
       ENTER_GL();
+      /*
       describeContext(dest);
-      /* Create the destination context with display lists shared */
+      / * Create the destination context with display lists shared * /
       dest->ctx = glXCreateContext(org->display, dest->vis, org->ctx, GetObjectType(org->hdc) == OBJ_MEMDC ? False : True);
+      */
+      dest = GetWineDelayedContext(dest, org->hdc, org);
       LEAVE_GL();
       TRACE(" created a delayed OpenGL context (%p) for Wine context %p sharing lists with OpenGL ctx %p\n", dest->ctx, dest, org->ctx);
       return TRUE;
