Commit 1b107ec0 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

quartz: Notify EC_USERABORT event when closing video window.

parent 567f9305
......@@ -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");
......
......@@ -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");
......
......@@ -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");
......
......@@ -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);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment