From: Akihiro Sagawa sagawa.aki@gmail.com
Signed-off-by: Akihiro Sagawa sagawa.aki@gmail.com --- dlls/mciqtz32/mciqtz.c | 15 ++++++++++++--- dlls/winmm/tests/mci.c | 4 ++-- 2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c index fb941f26a86..89f128831b6 100644 --- a/dlls/mciqtz32/mciqtz.c +++ b/dlls/mciqtz32/mciqtz.c @@ -998,9 +998,18 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS if (dwFlags & MCI_DGV_WINDOW_HWND && (IsWindow(lpParms->hWnd) || !lpParms->hWnd)) { HWND hwnd = lpParms->hWnd ? lpParms->hWnd : wma->window; TRACE("Setting parent window to %p.\n", hwnd); - IVideoWindow_put_MessageDrain(wma->vidwin, (OAHWND)hwnd); - IVideoWindow_put_Owner(wma->vidwin, (OAHWND)hwnd); - wma->parent = hwnd; + if (wma->parent != hwnd) + { + LONG width, height; + + IVideoWindow_put_MessageDrain(wma->vidwin, (OAHWND)hwnd); + IVideoWindow_put_Owner(wma->vidwin, (OAHWND)hwnd); + + IBasicVideo_GetVideoSize(wma->vidbasic, &width, &height); + IVideoWindow_SetWindowPosition(wma->vidwin, 0, 0, width, height); + + wma->parent = hwnd; + } } if (dwFlags & MCI_DGV_WINDOW_STATE) { TRACE("Setting nCmdShow to %d\n", lpParms->nCmdShow); diff --git a/dlls/winmm/tests/mci.c b/dlls/winmm/tests/mci.c index c4a92221d0f..dc3a4973362 100644 --- a/dlls/winmm/tests/mci.c +++ b/dlls/winmm/tests/mci.c @@ -1664,7 +1664,7 @@ static void test_video_window(void) /* destination size is reset to the source video size */ err = mciSendCommandW(id, MCI_WHERE, MCI_DGV_WHERE_DESTINATION, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); - todo_wine ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", + ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", wine_dbgstr_rect(&parm.where.rc), wine_dbgstr_rect(&src_rc));
/* destination size isn't reset unless the destination window is changed */ @@ -1699,7 +1699,7 @@ static void test_video_window(void)
err = mciSendCommandW(id, MCI_WHERE, MCI_DGV_WHERE_DESTINATION, (DWORD_PTR)&parm); ok(!err, "Got %s.\n", dbg_mcierr(err)); - todo_wine ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", + ok(EqualRect(&parm.where.rc, &src_rc), "Got destination rect %s, expected %s.\n", wine_dbgstr_rect(&parm.where.rc), wine_dbgstr_rect(&src_rc));
err = mciSendCommandW(id, MCI_CLOSE, 0, 0);