Fixes a regression introduced by
3b5198c8283d891095612c1001edb5e5788d6059. Media Player Classic deadlocks when
the window is destroyed, because DestroyWindow will notify the parent, which
is on a different thread and waiting on a signal from the filter's thread.
Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com>
---
Tests (next patch) also show that Windows does not notify the parent either,
despite not having the style set prior to destruction. So while this may
seem awkward, …
[View More]it's needed to replicate Windows behavior.
dlls/strmbase/window.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c
index 07a12ec..d646f7e 100644
--- a/dlls/strmbase/window.c
+++ b/dlls/strmbase/window.c
@@ -77,6 +77,13 @@ static LRESULT CALLBACK WndProcW(HWND hwnd, UINT message, WPARAM wparam, LPARAM
This->Width = LOWORD(lparam);
This->Height = HIWORD(lparam);
+ break;
+ case WM_CLOSE:
+ /* Some applications like Media Player Classic deadlock when the parent,
+ which is on a different thread, is notified before the destruction.
+ Windows also doesn't notify it, despite not having the style prior. */
+ SetWindowLongW(hwnd, GWL_EXSTYLE, GetWindowLongW(hwnd, GWL_EXSTYLE) | WS_EX_NOPARENTNOTIFY);
+ break;
}
return DefWindowProcW(hwnd, message, wparam, lparam);
--
2.21.0
[View Less]