Commit 0d92fe20 authored by Alexandre Julliard's avatar Alexandre Julliard

Make sure that returned window belongs to correct thread when checking

siblings of transparent windows in WIN_FindWinToRepaint.
parent 80f9d64f
......@@ -361,41 +361,39 @@ HWND WIN_FindWinToRepaint( HWND hwnd )
for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next))
{
if (!(pWnd->dwStyle & WS_VISIBLE))
{
TRACE("skipping window %04x\n",
pWnd->hwndSelf );
}
else if ((pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
if (!(pWnd->dwStyle & WS_VISIBLE)) continue;
if ((pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
break;
else if (pWnd->child )
if (pWnd->child )
{
if ((hwndRet = WIN_FindWinToRepaint( pWnd->child->hwndSelf )) )
{
WIN_ReleaseWndPtr(pWnd);
return hwndRet;
}
}
}
if(!pWnd)
{
TRACE("nothing found\n");
return 0;
}
hwndRet = pWnd->hwndSelf;
/* look among siblings if we got a transparent window */
while (pWnd && ((pWnd->dwExStyle & WS_EX_TRANSPARENT) ||
!(pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT))))
while (pWnd)
{
WIN_UpdateWndPtr(&pWnd,pWnd->next);
}
if (pWnd)
if (!(pWnd->dwExStyle & WS_EX_TRANSPARENT) &&
(pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
{
hwndRet = pWnd->hwndSelf;
WIN_ReleaseWndPtr(pWnd);
break;
}
WIN_UpdateWndPtr(&pWnd,pWnd->next);
}
TRACE("found %04x\n",hwndRet);
return hwndRet;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment