[PATCH 28/32] mciqtz32: Fix Window visibility
Maarten Lankhorst
m.b.lankhorst at gmail.com
Fri May 21 15:06:34 CDT 2010
---
dlls/mciqtz32/mciqtz.c | 16 +++++++++-------
1 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/dlls/mciqtz32/mciqtz.c b/dlls/mciqtz32/mciqtz.c
index a17e6d2..efd5a56 100644
--- a/dlls/mciqtz32/mciqtz.c
+++ b/dlls/mciqtz32/mciqtz.c
@@ -757,15 +757,12 @@ 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 style = 0;
TRACE("Setting hWnd to %p\n", lpParms->hWnd);
IVideoWindow_put_Visible(wma->vidwin, OAFALSE);
- IVideoWindow_get_WindowStyle(wma->vidwin, &style);
- style &= ~WS_CHILD;
if (lpParms->hWnd)
- IVideoWindow_put_WindowStyle(wma->vidwin, style|WS_CHILD);
+ IVideoWindow_put_WindowStyle(wma->vidwin, WS_CHILD);
else
- IVideoWindow_put_WindowStyle(wma->vidwin, style);
+ IVideoWindow_put_WindowStyle(wma->vidwin, 0);
IVideoWindow_put_Owner(wma->vidwin, (OAHWND)lpParms->hWnd);
IVideoWindow_put_MessageDrain(wma->vidwin, (OAHWND)lpParms->hWnd);
IVideoWindow_put_Visible(wma->vidwin, OATRUE);
@@ -805,18 +802,21 @@ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS
BITMAPINFO *info;
HRESULT hr;
RECT src, dest;
+ LONG old_state = State_Paused;
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);
- /* FIXME: Should we check the original state and restore it? */
+ IMediaControl_GetState(wma->pmctrl, -1, &old_state);
+ if (old_state == State_Stopped)
+ IVideoWindow_put_Visible(vidwin, OAFALSE);
IMediaControl_Pause(wma->pmctrl);
IMediaControl_GetState(wma->pmctrl, -1, &state);
if (FAILED(hr = IBasicVideo_GetCurrentImage(wma->vidbasic, &size, NULL))) {
WARN("Could not get image size (hr = %x)\n", hr);
goto out;
+
}
data = HeapAlloc(GetProcessHeap(), 0, size);
info = (BITMAPINFO*)data;
@@ -834,6 +834,8 @@ static DWORD MCIQTZ_mciUpdate(UINT wDevID, DWORD dwFlags, LPMCI_DGV_UPDATE_PARMS
out:
if (wma->parent)
IVideoWindow_put_Visible(wma->vidwin, OATRUE);
+ if (old_state == State_Running)
+ IMediaControl_Run(wma->pmctrl);
}
else if (dwFlags)
FIXME("Unhandled flags %x\n", dwFlags);
--
1.7.0.4
--------------070602050102020102090201--
More information about the wine-patches
mailing list