From: Elizabeth Figura zfigura@codeweavers.com
This fixes videos in some VisualArts applications.
Based on a patch by Attila Fidan. --- dlls/quartz/tests/videorenderer.c | 14 +++++++------- dlls/quartz/tests/vmr7.c | 14 +++++++------- dlls/quartz/tests/vmr9.c | 14 +++++++------- dlls/quartz/window.c | 8 ++++++++ 4 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 17ccff23cba..85a2aafef5a 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1718,10 +1718,10 @@ static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style); + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style); + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowStyle(window, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -1832,7 +1832,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(style == (WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_VISIBLE | WS_MINIMIZE), + ok(style == (WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_VISIBLE | WS_MINIMIZE), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowState(window, SW_RESTORE); @@ -2124,7 +2124,7 @@ static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hw ok(hr == S_OK, "Got hr %#lx.\n", hr);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_OVERLAPPEDWINDOW | WS_CHILD), "Got style %#lx.\n", style); + ok(style == (WS_OVERLAPPEDWINDOW | WS_CHILD), "Got style %#lx.\n", style);
hr = IVideoWindow_put_Owner(window, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2136,15 +2136,15 @@ static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hw parent = GetAncestor(hwnd, GA_PARENT); ok(parent == GetDesktopWindow(), "Got parent %p.\n", parent); style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == WS_OVERLAPPEDWINDOW, "Got style %#lx.\n", style); + ok(style == WS_OVERLAPPEDWINDOW, "Got style %#lx.\n", style);
ok(GetActiveWindow() == hwnd, "Got active window %p.\n", GetActiveWindow()); top_hwnd = get_top_window(); - todo_wine ok(top_hwnd == our_hwnd, "Got top window %p.\n", top_hwnd); + ok(top_hwnd == our_hwnd, "Got top window %p.\n", top_hwnd);
hr = IVideoWindow_get_Visible(window, &state); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(state == OAFALSE, "Got state %ld.\n", state); + ok(state == OAFALSE, "Got state %ld.\n", state); }
struct notify_message_params diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index c5e4e3a5aee..aeae2836349 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1733,10 +1733,10 @@ static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style); + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style); + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowStyle(window, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -1847,7 +1847,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(style == (WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_VISIBLE | WS_MINIMIZE), + ok(style == (WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_VISIBLE | WS_MINIMIZE), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowState(window, SW_RESTORE); @@ -2139,7 +2139,7 @@ static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hw ok(hr == S_OK, "Got hr %#lx.\n", hr);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_OVERLAPPEDWINDOW | WS_CHILD), "Got style %#lx.\n", style); + ok(style == (WS_OVERLAPPEDWINDOW | WS_CHILD), "Got style %#lx.\n", style);
hr = IVideoWindow_put_Owner(window, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2151,15 +2151,15 @@ static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hw parent = GetAncestor(hwnd, GA_PARENT); ok(parent == GetDesktopWindow(), "Got parent %p.\n", parent); style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == WS_OVERLAPPEDWINDOW, "Got style %#lx.\n", style); + ok(style == WS_OVERLAPPEDWINDOW, "Got style %#lx.\n", style);
ok(GetActiveWindow() == hwnd, "Got active window %p.\n", GetActiveWindow()); top_hwnd = get_top_window(); - todo_wine ok(top_hwnd == our_hwnd, "Got top window %p.\n", top_hwnd); + ok(top_hwnd == our_hwnd, "Got top window %p.\n", top_hwnd);
hr = IVideoWindow_get_Visible(window, &state); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(state == OAFALSE, "Got state %ld.\n", state); + ok(state == OAFALSE, "Got state %ld.\n", state); }
struct notify_message_params diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 6e1eab1a88e..beb4c529e7f 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1944,10 +1944,10 @@ static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style); + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style); + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowStyle(window, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2058,7 +2058,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(style == (WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_VISIBLE | WS_MINIMIZE), + ok(style == (WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_VISIBLE | WS_MINIMIZE), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowState(window, SW_RESTORE); @@ -2350,7 +2350,7 @@ static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hw ok(hr == S_OK, "Got hr %#lx.\n", hr);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_OVERLAPPEDWINDOW | WS_CHILD), "Got style %#lx.\n", style); + ok(style == (WS_OVERLAPPEDWINDOW | WS_CHILD), "Got style %#lx.\n", style);
hr = IVideoWindow_put_Owner(window, 0); ok(hr == S_OK, "Got hr %#lx.\n", hr); @@ -2362,15 +2362,15 @@ static void test_video_window_owner(IVideoWindow *window, HWND hwnd, HWND our_hw parent = GetAncestor(hwnd, GA_PARENT); ok(parent == GetDesktopWindow(), "Got parent %p.\n", parent); style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == WS_OVERLAPPEDWINDOW, "Got style %#lx.\n", style); + ok(style == WS_OVERLAPPEDWINDOW, "Got style %#lx.\n", style);
ok(GetActiveWindow() == hwnd, "Got active window %p.\n", GetActiveWindow()); top_hwnd = get_top_window(); - todo_wine ok(top_hwnd == our_hwnd, "Got top window %p.\n", top_hwnd); + ok(top_hwnd == our_hwnd, "Got top window %p.\n", top_hwnd);
hr = IVideoWindow_get_Visible(window, &state); ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine ok(state == OAFALSE, "Got state %ld.\n", state); + ok(state == OAFALSE, "Got state %ld.\n", state); }
struct notify_message_params diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 02c6a826bb2..684c05245a6 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -234,6 +234,14 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG s if (!window->pPin->peer) return VFW_E_NOT_CONNECTED;
+ /* Preserve the current visibility. + * Using IsWindowVisible() has the side effect that a visible child of an + * invisible window will be hidden by this call, but that's what native + * does. */ + style = (style & ~WS_VISIBLE); + if (IsWindowVisible(window->hwnd)) + style |= WS_VISIBLE; + SetWindowLongW(window->hwnd, GWL_STYLE, style); SetWindowPos(window->hwnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_FRAMECHANGED);