Module: wine Branch: master Commit: efcb73441428705cdd49bf41bd396c4e829ac5c8 URL: https://gitlab.winehq.org/wine/wine/-/commit/efcb73441428705cdd49bf41bd396c4...
Author: Zebediah Figura zfigura@codeweavers.com Date: Wed Oct 19 12:35:35 2022 -0500
wined3d: Set the window state thread description only if it's actually a new thread.
Fixes: a2c03e23565779d2743f5750c37de0be3f7222bf
---
dlls/wined3d/swapchain.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c index 4b420a749f3..346fd1e6497 100644 --- a/dlls/wined3d/swapchain.c +++ b/dlls/wined3d/swapchain.c @@ -2200,8 +2200,6 @@ static DWORD WINAPI set_window_state_thread(void *ctx) struct wined3d_window_state *s = ctx; bool filter;
- SetThreadDescription(GetCurrentThread(), L"wined3d_set_window_state"); - filter = wined3d_filter_messages(s->window, TRUE);
if (s->set_style) @@ -2229,11 +2227,18 @@ static void set_window_state(struct wined3d_window_state *s) * position can potentially deadlock if that thread isn't processing * messages. */ if (window_tid == tid) + { set_window_state_thread(s); - else if (!(thread = CreateThread(NULL, 0, set_window_state_thread, s, 0, NULL))) - ERR("Failed to create thread.\n"); - else + } + else if ((thread = CreateThread(NULL, 0, set_window_state_thread, s, 0, NULL))) + { + SetThreadDescription(thread, L"wined3d_set_window_state"); CloseHandle(thread); + } + else + { + ERR("Failed to create thread.\n"); + } }
HRESULT wined3d_swapchain_state_setup_fullscreen(struct wined3d_swapchain_state *state,