Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/quartz/tests/videorenderer.c | 8 ++++---- dlls/strmbase/window.c | 22 +++++++++------------- 2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/dlls/quartz/tests/videorenderer.c b/dlls/quartz/tests/videorenderer.c index 96a2b1cabbf..c851146af78 100644 --- a/dlls/quartz/tests/videorenderer.c +++ b/dlls/quartz/tests/videorenderer.c @@ -1619,7 +1619,7 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw ok(GetFocus() == hwnd, "Got focus window %p.\n", GetFocus()); ok(GetForegroundWindow() == hwnd, "Got foreground window %p.\n", GetForegroundWindow()); top = get_top_window(); - todo_wine ok(top == hwnd, "Got top window %p.\n", top); + ok(top == hwnd, "Got top window %p.\n", top);
hr = IVideoWindow_SetWindowForeground(window, OAFALSE); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -1632,9 +1632,9 @@ static void test_video_window_state(IVideoWindow *window, HWND hwnd, HWND our_hw SetWindowPos(our_hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); hr = IVideoWindow_SetWindowForeground(window, OAFALSE); ok(hr == S_OK, "Got hr %#x.\n", hr); - todo_wine ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow()); - todo_wine ok(GetFocus() == our_hwnd, "Got focus window %p.\n", GetFocus()); - todo_wine ok(GetForegroundWindow() == our_hwnd, "Got foreground window %p.\n", GetForegroundWindow()); + ok(GetActiveWindow() == our_hwnd, "Got active window %p.\n", GetActiveWindow()); + ok(GetFocus() == our_hwnd, "Got focus window %p.\n", GetFocus()); + ok(GetForegroundWindow() == our_hwnd, "Got foreground window %p.\n", GetForegroundWindow()); top = get_top_window(); ok(top == hwnd, "Got top window %p.\n", top); } diff --git a/dlls/strmbase/window.c b/dlls/strmbase/window.c index 57dbaca8bf3..9a915867833 100644 --- a/dlls/strmbase/window.c +++ b/dlls/strmbase/window.c @@ -654,29 +654,25 @@ HRESULT WINAPI BaseControlWindowImpl_put_FullScreenMode(IVideoWindow *iface, LON return E_NOTIMPL; }
-HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG Focus) +HRESULT WINAPI BaseControlWindowImpl_SetWindowForeground(IVideoWindow *iface, LONG focus) { - BaseControlWindow* This = impl_from_IVideoWindow(iface); - BOOL ret; + BaseControlWindow *window = impl_from_IVideoWindow(iface); + UINT flags = SWP_NOMOVE | SWP_NOSIZE; IPin* pPin; HRESULT hr;
- TRACE("(%p/%p)->(%d)\n", This, iface, Focus); + TRACE("window %p, focus %d.\n", window, focus);
- if ((Focus != OAFALSE) && (Focus != OATRUE)) + if (focus != OAFALSE && focus != OATRUE) return E_INVALIDARG;
- hr = IPin_ConnectedTo(&This->pPin->IPin_iface, &pPin); + hr = IPin_ConnectedTo(&window->pPin->IPin_iface, &pPin); if ((hr != S_OK) || !pPin) return VFW_E_NOT_CONNECTED;
- if (Focus) - ret = SetForegroundWindow(This->baseWindow.hWnd); - else - ret = SetWindowPos(This->baseWindow.hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); - - if (!ret) - return E_FAIL; + if (!focus) + flags |= SWP_NOACTIVATE; + SetWindowPos(window->baseWindow.hWnd, HWND_TOP, 0, 0, 0, 0, flags);
return S_OK; }