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.
This commit is contained in:
Aric Stewart 2010-09-27 11:11:22 -05:00 committed by Alexandre Julliard
parent f138a5724d
commit e2b3a7f479
1 changed files with 26 additions and 13 deletions

View File

@ -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;
}