Module: wine Branch: master Commit: e2b3a7f479463f9bf51263910a6d997318946c42 URL: http://source.winehq.org/git/wine.git/?a=commit;h=e2b3a7f479463f9bf51263910a...
Author: Aric Stewart aric@codeweavers.com Date: Mon Sep 27 11:11:22 2010 -0500
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 | 47 +++++++++++++++++++++++++++--------------- 1 files changed, 30 insertions(+), 17 deletions(-)
diff --git a/dlls/quartz/videorenderer.c b/dlls/quartz/videorenderer.c index d3ccede..9469427 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.bottom) - This->WindowPos = This->SourceRect; - - 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); - - GetClientRect(This->hWnd, &This->DestRect); + 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.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); + + 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); + } + else + This->DestRect = This->WindowPos; This->init = TRUE; }