quartz: Hide video window on WM_CLOSE.

Signed-off-by: Akihiro Sagawa <sagawa.aki@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Akihiro Sagawa 2021-06-02 23:07:58 +09:00 committed by Alexandre Julliard
parent b0458a318f
commit 567f930583
4 changed files with 15 additions and 7 deletions

View File

@ -1346,7 +1346,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
todo_wine ok(IsWindow(hwnd), "Window should exist.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
thread = send_frame(input);
@ -1385,7 +1385,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
todo_wine ok(IsWindow(hwnd), "Window should exist.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
hr = IMediaControl_Stop(control);

View File

@ -1377,7 +1377,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
todo_wine ok(IsWindow(hwnd), "Window should exist.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
thread = send_frame(input);
@ -1417,7 +1417,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
todo_wine ok(IsWindow(hwnd), "Window should exist.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
hr = IMediaControl_Stop(control);

View File

@ -1582,7 +1582,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
todo_wine ok(IsWindow(hwnd), "Window should exist.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
thread = send_frame(input);
@ -1622,7 +1622,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
todo_wine ok(IsWindow(hwnd), "Window should exist.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
hr = IMediaControl_Stop(control);

View File

@ -20,6 +20,8 @@
#include "quartz_private.h"
#define WM_QUARTZ_DESTROY (WM_USER + WM_DESTROY)
WINE_DEFAULT_DEBUG_CHANNEL(quartz);
static const WCHAR class_name[] = L"wine_quartz_window";
@ -71,6 +73,12 @@ static LRESULT CALLBACK WndProcW(HWND hwnd, UINT message, WPARAM wparam, LPARAM
if (window->default_dst)
GetClientRect(window->hwnd, &window->dst);
break;
case WM_QUARTZ_DESTROY:
DestroyWindow(hwnd);
return 0;
case WM_CLOSE:
IVideoWindow_put_Visible(&window->IVideoWindow_iface, OAFALSE);
return 0;
}
return DefWindowProcW(hwnd, message, wparam, lparam);
@ -1251,7 +1259,7 @@ void video_window_cleanup(struct video_window *window)
* it would become top-level for a brief period before being destroyed. */
SetWindowLongW(window->hwnd, GWL_STYLE, GetWindowLongW(window->hwnd, GWL_STYLE) & ~WS_CHILD);
SendMessageW(window->hwnd, WM_CLOSE, 0, 0);
SendMessageW(window->hwnd, WM_QUARTZ_DESTROY, 0, 0);
window->hwnd = NULL;
}
}