From: Elizabeth Figura zfigura@codeweavers.com
Based on a patch by Attila Fidan. --- dlls/quartz/tests/videorenderer.c | 32 +++++++++++++++++++++++++++---- dlls/quartz/tests/vmr7.c | 32 +++++++++++++++++++++++++++---- dlls/quartz/tests/vmr9.c | 32 +++++++++++++++++++++++++++---- 3 files changed, 84 insertions(+), 12 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index ea54ec87a8e..27d211b819a 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1713,15 +1713,31 @@ static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hw hr = IVideoWindow_put_WindowStyle(window, style | WS_MINIMIZE); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
- hr = IVideoWindow_put_WindowStyle(window, style & ~WS_CLIPCHILDREN); + hr = IVideoWindow_put_WindowStyle(window, + (style | WS_VISIBLE | WS_POPUP | WS_GROUP | WS_TABSTOP) & ~WS_CLIPCHILDREN); ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW), "Got style %#lx.\n", style); + todo_wine 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), + "Got style %#lx.\n", style); + + hr = IVideoWindow_put_WindowStyle(window, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IVideoWindow_get_WindowStyle(window, &style); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(style == WS_CLIPSIBLINGS, "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW), "Got style %#lx.\n", style); + ok(style == WS_CLIPSIBLINGS, "Got style %#lx.\n", style); + + hr = IVideoWindow_put_WindowStyle(window, WS_OVERLAPPEDWINDOW); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
flaky_wine ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow()); @@ -1765,8 +1781,8 @@ static HWND get_top_window(void)
static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hwnd) { + LONG state, style; HRESULT hr; - LONG state; HWND top;
SetWindowPos(our_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); @@ -1814,6 +1830,14 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw ok(!IsZoomed(hwnd), "Window should not be maximized.\n"); ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow());
+ hr = IVideoWindow_put_WindowStyle(window, WS_OVERLAPPEDWINDOW); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + 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), + "Got style %#lx.\n", style); + hr = IVideoWindow_put_WindowState(window, SW_RESTORE); ok(hr == S_OK, "Got hr %#lx.\n", hr);
diff --git a/dlls/quartz/tests/vmr7.c b/dlls/quartz/tests/vmr7.c index ff15ad9c81d..8e63d5fdae6 100644 --- a/dlls/quartz/tests/vmr7.c +++ b/dlls/quartz/tests/vmr7.c @@ -1728,15 +1728,31 @@ static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hw hr = IVideoWindow_put_WindowStyle(window, style | WS_MINIMIZE); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
- hr = IVideoWindow_put_WindowStyle(window, style & ~WS_CLIPCHILDREN); + hr = IVideoWindow_put_WindowStyle(window, + (style | WS_VISIBLE | WS_POPUP | WS_GROUP | WS_TABSTOP) & ~WS_CLIPCHILDREN); ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW), "Got style %#lx.\n", style); + todo_wine 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), + "Got style %#lx.\n", style); + + hr = IVideoWindow_put_WindowStyle(window, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IVideoWindow_get_WindowStyle(window, &style); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(style == WS_CLIPSIBLINGS, "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW), "Got style %#lx.\n", style); + ok(style == WS_CLIPSIBLINGS, "Got style %#lx.\n", style); + + hr = IVideoWindow_put_WindowStyle(window, WS_OVERLAPPEDWINDOW); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
flaky_wine ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow()); @@ -1780,8 +1796,8 @@ static HWND get_top_window(void)
static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hwnd) { + LONG state, style; HRESULT hr; - LONG state; HWND top;
SetWindowPos(our_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); @@ -1829,6 +1845,14 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw ok(!IsZoomed(hwnd), "Window should not be maximized.\n"); ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow());
+ hr = IVideoWindow_put_WindowStyle(window, WS_OVERLAPPEDWINDOW); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + 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), + "Got style %#lx.\n", style); + hr = IVideoWindow_put_WindowState(window, SW_RESTORE); ok(hr == S_OK, "Got hr %#lx.\n", hr);
diff --git a/dlls/quartz/tests/vmr9.c b/dlls/quartz/tests/vmr9.c index bdd3516da73..48a6229a099 100644 --- a/dlls/quartz/tests/vmr9.c +++ b/dlls/quartz/tests/vmr9.c @@ -1939,15 +1939,31 @@ static void test_video_window_style(IVideoWindow *window, HWND hwnd, HWND our_hw hr = IVideoWindow_put_WindowStyle(window, style | WS_MINIMIZE); ok(hr == E_INVALIDARG, "Got hr %#lx.\n", hr);
- hr = IVideoWindow_put_WindowStyle(window, style & ~WS_CLIPCHILDREN); + hr = IVideoWindow_put_WindowStyle(window, + (style | WS_VISIBLE | WS_POPUP | WS_GROUP | WS_TABSTOP) & ~WS_CLIPCHILDREN); ok(hr == S_OK, "Got hr %#lx.\n", hr);
hr = IVideoWindow_get_WindowStyle(window, &style); ok(hr == S_OK, "Got hr %#lx.\n", hr); - ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW), "Got style %#lx.\n", style); + todo_wine 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), + "Got style %#lx.\n", style); + + hr = IVideoWindow_put_WindowStyle(window, 0); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + hr = IVideoWindow_get_WindowStyle(window, &style); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + ok(style == WS_CLIPSIBLINGS, "Got style %#lx.\n", style);
style = GetWindowLongA(hwnd, GWL_STYLE); - ok(style == (WS_CLIPSIBLINGS | WS_OVERLAPPEDWINDOW), "Got style %#lx.\n", style); + ok(style == WS_CLIPSIBLINGS, "Got style %#lx.\n", style); + + hr = IVideoWindow_put_WindowStyle(window, WS_OVERLAPPEDWINDOW); + ok(hr == S_OK, "Got hr %#lx.\n", hr);
flaky_wine ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow()); @@ -1991,8 +2007,8 @@ static HWND get_top_window(void)
static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hwnd) { + LONG state, style; HRESULT hr; - LONG state; HWND top;
SetWindowPos(our_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); @@ -2040,6 +2056,14 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw ok(!IsZoomed(hwnd), "Window should not be maximized.\n"); ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow());
+ hr = IVideoWindow_put_WindowStyle(window, WS_OVERLAPPEDWINDOW); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + 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), + "Got style %#lx.\n", style); + hr = IVideoWindow_put_WindowState(window, SW_RESTORE); ok(hr == S_OK, "Got hr %#lx.\n", hr);
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);
This merge request was approved by Elizabeth Figura.
Native doesn't consider the window to be currently visible if it has WS_VISIBLE but a parent doesn't have WS_VISIBLE. The window should lose WS_VISIBLE if `!IsWindowVisible`.