quartz: Clear the WS_CHILD style instead of unparenting the window.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48732
Signed-off-by: Gabriel Ivăncescu <gabrielopcode@gmail.com>
Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Gabriel Ivăncescu 2020-03-16 18:54:51 +02:00 committed by Alexandre Julliard
parent 9e33f3f312
commit 5c8903a0a9
2 changed files with 9 additions and 5 deletions

View file

@ -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);

View file

@ -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;