Rémi Bernon (@rbernon) commented about dlls/opengl32/unix_wgl.c:
if (ctx->tid) return ctx; /* currently in use */ if (ctx->share == (HGLRC)-1) return ctx; /* not re-shared */ + if (!NtUserWindowFromDC( ctx->hdc )) + { + WARN( "Skipping context re-create, invalid HDC\n" ); + return ctx; + }
share = ctx->share ? get_updated_context( teb, ctx->share ) : NULL; if (!funcs->p_wgl_context_reset( &ctx->base, ctx->hdc, share ? &share->base : NULL, ctx->attribs )) { WARN( "Failed to re-create context for wglShareLists\n" ); return ctx; }
This seems to be that the stored hdc isn't valid anymore at the time we try to recreate the context. The thing is that we probably don't need the hdc, but rather only the pixel format. The pixel format is stored already, we just need a way to use it rather than the hdc when updating a context for re-sharing. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9986#note_128255