Maarten Lankhorst : mciqtz32: Fix window visibility.

Alexandre Julliard julliard at winehq.org
Mon Aug 16 12:25:01 CDT 2010


Module: wine
Branch: master
Commit: 1583057fc876949cfbfee4119fb597313657808e
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=1583057fc876949cfbfee4119fb597313657808e

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Mon Aug  9 14:24:31 2010 +0200

mciqtz32: Fix window visibility.

---

 dlls/mciqtz32/mciqtz.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c
index 35a2f17..fef27e7 100644
--- a/dlls/mciqtz32/mciqtz.c
+++ b/dlls/mciqtz32/mciqtz.c
@@ -330,8 +330,7 @@ static DWORD MCIQTZ_mciPlay(UINT wDevID, DWORD dwFlags, LPMCI_PLAY_PARMS lpParms
         return MCIERR_INTERNAL;
     }
 
-    if (!wma->parent)
-        IVideoWindow_put_Visible(wma->vidwin, OATRUE);
+    IVideoWindow_put_Visible(wma->vidwin, OATRUE);
 
     if (dwFlags & MCI_NOTIFY)
         mciDriverNotify(HWND_32(LOWORD(lpParms->dwCallback)), wDevID, MCI_NOTIFY_SUCCESSFUL);
@@ -770,8 +769,10 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS
         return 0;
 
     if (dwFlags & MCI_DGV_WINDOW_HWND && (IsWindow(lpParms->hWnd) || !lpParms->hWnd)) {
+        LONG visible = OATRUE;
         LONG style = 0;
         TRACE("Setting hWnd to %p\n", lpParms->hWnd);
+        IVideoWindow_get_Visible(wma->vidwin, &visible);
         IVideoWindow_put_Visible(wma->vidwin, OAFALSE);
         IVideoWindow_get_WindowStyle(wma->vidwin, &style);
         style &= ~WS_CHILD;
@@ -781,7 +782,7 @@ static DWORD MCIQTZ_mciWindow(UINT wDevID, DWORD dwFlags, LPMCI_DGV_WINDOW_PARMS
             IVideoWindow_put_WindowStyle(wma->vidwin, style);
         IVideoWindow_put_Owner(wma->vidwin, (OAHWND)lpParms->hWnd);
         IVideoWindow_put_MessageDrain(wma->vidwin, (OAHWND)lpParms->hWnd);
-        IVideoWindow_put_Visible(wma->vidwin, OATRUE);
+        IVideoWindow_put_Visible(wma->vidwin, visible);
         wma->parent = lpParms->hWnd;
     }
     if (dwFlags & MCI_DGV_WINDOW_STATE) {
@@ -818,12 +819,15 @@ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS
         BITMAPINFO *info;
         HRESULT hr;
         RECT src, dest;
+        LONG visible = OATRUE;
 
         res = MCIERR_INTERNAL;
         /* If in stopped state, nothing has been drawn to screen
          * moving to pause, which is needed for the old dib renderer, will result
          * in a single frame drawn, so hide the window here */
-        IVideoWindow_put_Visible(wma->vidwin, OAFALSE);
+        IVideoWindow_get_Visible(wma->vidwin, &visible);
+        if (wma->parent)
+            IVideoWindow_put_Visible(wma->vidwin, OAFALSE);
         /* FIXME: Should we check the original state and restore it? */
         IMediaControl_Pause(wma->pmctrl);
         IMediaControl_GetState(wma->pmctrl, -1, &state);
@@ -846,7 +850,7 @@ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS
         res = 0;
 out:
         if (wma->parent)
-            IVideoWindow_put_Visible(wma->vidwin, OATRUE);
+            IVideoWindow_put_Visible(wma->vidwin, visible);
     }
     else if (dwFlags)
         FIXME("Unhandled flags %x\n", dwFlags);




More information about the wine-cvs mailing list