Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48732 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/quartz/tests/filtergraph.c | 4 ++++ dlls/quartz/window.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/dlls/quartz/tests/filtergraph.c b/dlls/quartz/tests/filtergraph.c index 01152c2..f8b80dd 100644 --- a/dlls/quartz/tests/filtergraph.c +++ b/dlls/quartz/tests/filtergraph.c @@ -4380,11 +4380,15 @@ static void test_window_threading(void) else skip("Could not find renderer window.\n");
+ SetActiveWindow(parent); expect_parent_message = FALSE; ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); expect_parent_message = TRUE;
+ hwnd = GetActiveWindow(); + ok(hwnd == parent, "Parent window lost focus, active window %p.\n", hwnd); + hr = CoCreateInstance(&CLSID_FilterGraphNoThread, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&graph); ok(hr == S_OK, "Got hr %#x.\n", hr); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 0b0df13..4656bad 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -136,14 +136,14 @@ HRESULT WINAPI BaseWindowImpl_PrepareWindow(BaseWindow *This)
HRESULT WINAPI BaseWindowImpl_DoneWithWindow(BaseWindow *This) { - BaseControlWindow *window = impl_from_BaseWindow(This); - if (!This->hWnd) return S_OK;
- /* Media Player Classic deadlocks if WM_PARENTNOTIFY is sent, so unparent - * the window first. */ - IVideoWindow_put_Owner(&window->IVideoWindow_iface, 0); + /* Media Player Classic deadlocks if WM_PARENTNOTIFY is sent, so clear + * the child style first. Just like Windows, we don't actually unparent + * the window, to prevent extra focus events from being generated since + * it would become top-level for a brief period before being destroyed. */ + SetWindowLongW(This->hWnd, GWL_STYLE, GetWindowLongW(This->hWnd, GWL_STYLE) & ~WS_CHILD);
SendMessageW(This->hWnd, WM_CLOSE, 0, 0); This->hWnd = NULL;