From: Rémi Bernon <rbernon(a)codeweavers.com> We won't be able to do it later on otherwise as get_dc_ptr will fail with a disabled DC, and release_dce will then not clear the drawable. This will delay the drawable release until the dce is later reused, for instance for a different window, which may cause a complicated deadlock. --- dlls/win32u/dce.c | 1 + dlls/win32u/win32u_private.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/win32u/dce.c b/dlls/win32u/dce.c index 29f11e18256..d1cf5c78bab 100644 --- a/dlls/win32u/dce.c +++ b/dlls/win32u/dce.c @@ -1224,6 +1224,7 @@ static INT release_dc( HWND hwnd, HDC hdc, BOOL end_paint ) if (end_paint || (dce->flags & DCX_CACHE)) delete_clip_rgn( dce ); if (dce->flags & DCX_CACHE) { + set_dc_opengl_drawable( dce->hdc, NULL ); dce->count = 0; set_dce_flags( dce->hdc, DCHF_DISABLEDC ); } diff --git a/dlls/win32u/win32u_private.h b/dlls/win32u/win32u_private.h index 780e8cd26cc..e683f7cd824 100644 --- a/dlls/win32u/win32u_private.h +++ b/dlls/win32u/win32u_private.h @@ -193,7 +193,7 @@ extern void user_check_not_lock(void); /* opengl.c */ struct opengl_drawable; -void set_dc_opengl_drawable( HDC hdc, struct opengl_drawable *new_drawable ); +extern void set_dc_opengl_drawable( HDC hdc, struct opengl_drawable *new_drawable ); /* d3dkmtc. */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/8694