Module: wine Branch: master Commit: a3d3b399ff724205470f0ba6c27110fba3995bd9 URL: https://source.winehq.org/git/wine.git/?a=commit;h=a3d3b399ff724205470f0ba6c...
Author: Zebediah Figura z.figura12@gmail.com Date: Tue Oct 8 20:02:20 2019 -0500
strmbase: Properly implement IVideoWindow::get_WindowState().
Signed-off-by: Zebediah Figura z.figura12@gmail.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/quartz/tests/videorenderer.c | 14 +++++++------- dlls/strmbase/window.c | 21 ++++++++++++++------- 2 files changed, 21 insertions(+), 14 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 1c16fa1f82..96a2b1cabb 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1487,7 +1487,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_HIDE, "Got state %d.\n", state); + ok(state == SW_HIDE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OAFALSE, "Got state %d.\n", state); @@ -1501,7 +1501,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_SHOW, "Got state %d.\n", state); + ok(state == SW_SHOW, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OATRUE, "Got state %d.\n", state); @@ -1518,7 +1518,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_MINIMIZE, "Got state %d.\n", state); + ok(state == SW_MINIMIZE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OATRUE, "Got state %d.\n", state); @@ -1533,7 +1533,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_SHOW, "Got state %d.\n", state); + ok(state == SW_SHOW, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OATRUE, "Got state %d.\n", state); @@ -1566,7 +1566,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_HIDE, "Got state %d.\n", state); + ok(state == SW_HIDE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OAFALSE, "Got state %d.\n", state); @@ -1581,7 +1581,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_SHOW, "Got state %d.\n", state); + ok(state == SW_SHOW, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OATRUE, "Got state %d.\n", state); @@ -1596,7 +1596,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw
hr = IVideoWindow_get_WindowState(window, &state); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(state == SW_HIDE, "Got state %d.\n", state); + ok(state == SW_HIDE, "Got state %d.\n", state);
hr = IVideoWindow_get_Visible(window, &state); ok(state == OAFALSE, "Got state %d.\n", state); diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index 206aecb8de..57dbaca8bf 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -402,15 +402,22 @@ HRESULT WINAPI BaseControlWindowImpl_put_WindowState(IVideoWindow *iface, LONG W return S_OK; }
-HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *WindowState) +HRESULT WINAPI BaseControlWindowImpl_get_WindowState(IVideoWindow *iface, LONG *state) { - WINDOWPLACEMENT place; - BaseControlWindow* This = impl_from_IVideoWindow(iface); + BaseControlWindow *window = impl_from_IVideoWindow(iface); + DWORD style;
- place.length = sizeof(place); - GetWindowPlacement(This->baseWindow.hWnd, &place); - TRACE("(%p/%p)->(%p)\n", This, iface, WindowState); - *WindowState = place.showCmd; + TRACE("window %p, state %p.\n", window, state); + + style = GetWindowLongPtrW(window->baseWindow.hWnd, GWL_STYLE); + if (!(style & WS_VISIBLE)) + *state = SW_HIDE; + else if (style & WS_MINIMIZE) + *state = SW_MINIMIZE; + else if (style & WS_MAXIMIZE) + *state = SW_MAXIMIZE; + else + *state = SW_SHOW;
return S_OK; }