[PATCH 0/1] MR9798: wined3d: Update the context DC from its swapchain if it changed.
The context keeps a weak pointer to the swapchain, and the swapchain might be destroyed while are context still have a pointer to them. It's usually not causing issues because contexts will be refreshed with the new active swapchain before a present is executed. However, the new swapchain might be for the same window but might have a different DC. As we now borrow the DCs from the swapchains, we also need to check if the context DC needs to be updated. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58709 Instead of https://gitlab.winehq.org/wine/wine/-/merge_requests/9778 -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9798
From: Rémi Bernon <rbernon@codeweavers.com> The context keeps a weak pointer to the swapchain, and the swapchain might be destroyed while are context still have a pointer to them. It's usually not causing issues because contexts will be refreshed with the new active swapchain before a present is executed. However, the new swapchain might be for the same window but might have a different DC. As we now borrow the DCs from the swapchains, we also need to check if the context DC needs to be updated. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58709 --- dlls/wined3d/context_gl.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/context_gl.c b/dlls/wined3d/context_gl.c index 6c1b169f4f4..ee0335ca3c4 100644 --- a/dlls/wined3d/context_gl.c +++ b/dlls/wined3d/context_gl.c @@ -1295,7 +1295,8 @@ static void wined3d_context_gl_update_window(struct wined3d_context_gl *context_ if (!context_gl->c.swapchain) return; - if (context_gl->window == context_gl->c.swapchain->win_handle) + if (context_gl->window == context_gl->c.swapchain->win_handle && + context_gl->dc == context_gl->c.swapchain->dc) return; TRACE("Updating context %p window from %p to %p.\n", -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/9798
This merge request was approved by Elizabeth Figura. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/9798
participants (3)
-
Elizabeth Figura (@zfigura) -
Rémi Bernon -
Rémi Bernon (@rbernon)