Akihiro Sagawa : mciqtz32: Reset the video size when changing video destination.

Alexandre Julliard julliard at winehq.org
Wed Aug 10 14:54:34 CDT 2022


Module: wine
Branch: master
Commit: 9cdc68126530012d67f17c2ae6528ceea767f89e
URL:    https://gitlab.winehq.org/wine/wine/-/commit/9cdc68126530012d67f17c2ae6528ceea767f89e

Author: Akihiro Sagawa <sagawa.aki at gmail.com>
Date:   Sun Jul 31 20:49:25 2022 +0900

mciqtz32: Reset the video size when changing video destination.

Signed-off-by: Akihiro Sagawa <sagawa.aki at 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);




More information about the wine-cvs mailing list