From e2b3a7f479463f9bf51263910a6d997318946c42 Mon Sep 17 00:00:00 2001 From: Aric Stewart Date: Mon, 27 Sep 2010 11:11:22 -0500 Subject: [PATCH] quartz: Improve video window sizing on first sample. Preserve sizes set by the application and defer erasing as it is not needed and can cause deadlock between threads with child video windows. --- dlls/quartz/videorenderer.c | 39 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index d3cceded1c9..94694273963 100644 --- a/dlls/quartz/videorenderer.c +++ b/dlls/quartz/videorenderer.c @@ -298,23 +298,36 @@ static DWORD VideoRenderer_SendSampleData(VideoRendererImpl* This, LPBYTE data, if (!This->init) { - DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE); - DWORD style_ex = GetWindowLongW(This->hWnd, GWL_EXSTYLE); + if (!This->WindowPos.right || !This->WindowPos.top) + { + DWORD style = GetWindowLongW(This->hWnd, GWL_STYLE); + DWORD style_ex = GetWindowLongW(This->hWnd, GWL_EXSTYLE); - if (!This->WindowPos.right || !This->WindowPos.bottom) - This->WindowPos = This->SourceRect; + if (!This->WindowPos.right) + { + This->WindowPos.left = This->SourceRect.left; + This->WindowPos.right = This->SourceRect.right; + } + if (!This->WindowPos.bottom) + { + This->WindowPos.top = This->SourceRect.top; + This->WindowPos.bottom = This->SourceRect.bottom; + } - AdjustWindowRectEx(&This->WindowPos, style, TRUE, style_ex); + AdjustWindowRectEx(&This->WindowPos, style, TRUE, style_ex); - TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom); - SetWindowPos(This->hWnd, NULL, - This->WindowPos.left, - This->WindowPos.top, - This->WindowPos.right - This->WindowPos.left, - This->WindowPos.bottom - This->WindowPos.top, - SWP_NOZORDER|SWP_NOMOVE); + TRACE("WindowPos: %d %d %d %d\n", This->WindowPos.left, This->WindowPos.top, This->WindowPos.right, This->WindowPos.bottom); + SetWindowPos(This->hWnd, NULL, + This->WindowPos.left, + This->WindowPos.top, + This->WindowPos.right - This->WindowPos.left, + This->WindowPos.bottom - This->WindowPos.top, + SWP_NOZORDER|SWP_NOMOVE|SWP_DEFERERASE); - GetClientRect(This->hWnd, &This->DestRect); + GetClientRect(This->hWnd, &This->DestRect); + } + else + This->DestRect = This->WindowPos; This->init = TRUE; }