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 | 6 +++--- dlls/quartz/tests/vmr7.c | 6 +++--- dlls/quartz/tests/vmr9.c | 6 +++--- dlls/quartz/window.c | 3 +++ 4 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 27d211b819a..9f47dd13c17 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1719,11 +1719,11 @@ 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 | WS_GROUP | WS_TABSTOP), + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowStyle(window, 0); @@ -1835,7 +1835,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); diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index 8e63d5fdae6..53d58d36f44 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1734,11 +1734,11 @@ 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 | WS_GROUP | WS_TABSTOP), + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowStyle(window, 0); @@ -1850,7 +1850,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); diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index 48a6229a099..fb0e52ee059 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1945,11 +1945,11 @@ 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 | WS_GROUP | WS_TABSTOP), + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - todo_wine ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), + ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW | WS_POPUP | WS_GROUP | WS_TABSTOP), "Got style %#lx.\n", style);
hr = IVideoWindow_put_WindowStyle(window, 0); @@ -2061,7 +2061,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); diff --git a/dlls/quartz/window.c b/dlls/quartz/window.c index 02c6a826bb2..2612878bbbd 100644 --- a/dlls/quartz/window.c +++ b/dlls/quartz/window.c @@ -234,6 +234,9 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowStyle(IVideoWindow *iface, LONG s if (!window->pPin->peer) return VFW_E_NOT_CONNECTED;
+ /* Preserve the current visibility. */ + style = (style & ~WS_VISIBLE) | (GetWindowLongW(window->hwnd, GWL_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);