quartz: Notify EC_USERABORT event when closing video window.

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:08:00 +09:00 committed by Alexandre Julliard
parent 567f930583
commit 1b107ec03e
4 changed files with 17 additions and 6 deletions

View File

@ -1344,7 +1344,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
ok(ret == 1, "Expected EC_USERABORT.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
@ -1383,7 +1383,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
SendMessageW(hwnd, WM_CLOSE, 0, 0);
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
ok(ret == 1, "Expected EC_USERABORT.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");

View File

@ -1375,7 +1375,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
ok(ret == 1, "Expected EC_USERABORT.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
@ -1415,7 +1415,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
SendMessageW(hwnd, WM_CLOSE, 0, 0);
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
ok(ret == 1, "Expected EC_USERABORT.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");

View File

@ -1580,7 +1580,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
hr = IMediaControl_GetState(control, 1000, &state);
ok(hr == VFW_S_STATE_INTERMEDIATE, "Got hr %#x.\n", hr);
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
ok(ret == 1, "Expected EC_USERABORT.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");
@ -1620,7 +1620,7 @@ static void test_window_close(IPin *pin, IMemInputPin *input, IMediaControl *con
SendMessageW(hwnd, WM_CLOSE, 0, 0);
ret = check_ec_userabort(eventsrc, 0);
todo_wine ok(ret == 1, "Expected EC_USERABORT.\n");
ok(ret == 1, "Expected EC_USERABORT.\n");
ok(IsWindow(hwnd), "Window should exist.\n");
ok(!IsWindowVisible(hwnd), "Window should be visible.\n");

View File

@ -77,9 +77,20 @@ static LRESULT CALLBACK WndProcW(HWND hwnd, UINT message, WPARAM wparam, LPARAM
DestroyWindow(hwnd);
return 0;
case WM_CLOSE:
{
IFilterGraph *graph = window->pFilter->graph;
IMediaEventSink *event_sink;
IVideoWindow_put_Visible(&window->IVideoWindow_iface, OAFALSE);
if (graph && SUCCEEDED(IFilterGraph_QueryInterface(graph,
&IID_IMediaEventSink,
(void **)&event_sink)))
{
IMediaEventSink_Notify(event_sink, EC_USERABORT, 0, 0);
IMediaEventSink_Release(event_sink);
}
return 0;
}
}
return DefWindowProcW(hwnd, message, wparam, lparam);
}