From: Attila Fidan dev@print0.net
Some applications set the window style while the window is visible, such as after pausing or running the graph with AutoShow enabled. On native, the window remains visible even if WS_VISIBLE isn't included. --- dlls/quartz/tests/videorenderer.c | 4 ++-- dlls/quartz/tests/vmr7.c | 4 ++-- dlls/quartz/tests/vmr9.c | 4 ++-- dlls/quartz/window.c | 7 +++++-- 4 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index d4296de6226..42a1c6c6594 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -2328,7 +2328,7 @@ static void test_video_window_visibility(IVideoWindow *window, IFilterGraph2 *gr
hr = IVideoWindow_get_Visible(window, &l); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(l == OATRUE, "Got %ld.\n", l); + ok(l == OATRUE, "Got %ld.\n", l);
hr = IVideoWindow_put_Visible(window, OAFALSE); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2344,7 +2344,7 @@ static void test_video_window_visibility(IVideoWindow *window, IFilterGraph2 *gr
hr = IVideoWindow_get_Visible(window, &l); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(l == OATRUE, "Got %ld.\n", l); + ok(l == OATRUE, "Got %ld.\n", l);
hr = IVideoWindow_put_Owner(window, (OAHWND)our_hwnd); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 9d5a3255389..75b3fd221fd 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -2343,7 +2343,7 @@ static void test_video_window_visibility(IVideoWindow *window, IFilterGraph2 *gr
hr = IVideoWindow_get_Visible(window, &l); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(l == OATRUE, "Got %ld.\n", l); + ok(l == OATRUE, "Got %ld.\n", l);
hr = IVideoWindow_put_Visible(window, OAFALSE); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2359,7 +2359,7 @@ static void test_video_window_visibility(IVideoWindow *window, IFilterGraph2 *gr
hr = IVideoWindow_get_Visible(window, &l); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(l == OATRUE, "Got %ld.\n", l); + ok(l == OATRUE, "Got %ld.\n", l);
hr = IVideoWindow_put_Owner(window, (OAHWND)our_hwnd); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 1ac50e13766..db0d9d35796 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -2554,7 +2554,7 @@ static void test_video_window_visibility(IVideoWindow *window, IFilterGraph2 *gr
hr = IVideoWindow_get_Visible(window, &l); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(l == OATRUE, "Got %ld.\n", l); + ok(l == OATRUE, "Got %ld.\n", l);
hr = IVideoWindow_put_Visible(window, OAFALSE); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2570,7 +2570,7 @@ static void test_video_window_visibility(IVideoWindow *window, IFilterGraph2 *gr
hr = IVideoWindow_get_Visible(window, &l); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(l == OATRUE, "Got %ld.\n", l); + ok(l == OATRUE, "Got %ld.\n", l);
hr = IVideoWindow_put_Owner(window, (OAHWND)our_hwnd); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 02c6a826bb2..41777c0bb6e 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -226,6 +226,7 @@ HRESULT WINAPI BaseControlWindowImpl_get_Caption(IVideoWindow *iface, BSTR *capt HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG style) { struct video_window *window = impl_from_IVideoWindow(iface); + UINT flags = SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED;
TRACE("window %p, style %#lx.\n", window, style);
@@ -234,9 +235,11 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG s if (!window->pPin->peer) return VFW_E_NOT_CONNECTED;
+ if (IsWindowVisible(window->hwnd)) + flags |= SWP_SHOWWINDOW; + SetWindowLongW(window->hwnd, GWL_STYLE, style); - SetWindowPos(window->hwnd, 0, 0, 0, 0, 0, - SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED); + SetWindowPos(window->hwnd, 0, 0, 0, 0, 0, flags); return S_OK; }