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 ) ...@@ -361,41 +361,39 @@ HWND WIN_FindWinToRepaint( HWND hwnd )
for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next)) for ( ; pWnd ; WIN_UpdateWndPtr(&pWnd,pWnd->next))
{ {
if (!(pWnd->dwStyle & WS_VISIBLE)) if (!(pWnd->dwStyle & WS_VISIBLE)) continue;
{ if ((pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
TRACE("skipping window %04x\n",
pWnd->hwndSelf );
}
else if ((pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId()) GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
break; break;
if (pWnd->child )
else if (pWnd->child ) {
if ((hwndRet = WIN_FindWinToRepaint( pWnd->child->hwndSelf )) ) if ((hwndRet = WIN_FindWinToRepaint( pWnd->child->hwndSelf )) )
{ {
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWnd);
return hwndRet; return hwndRet;
} }
}
} }
if(!pWnd) if(!pWnd)
{ {
TRACE("nothing found\n");
return 0; return 0;
} }
hwndRet = pWnd->hwndSelf; hwndRet = pWnd->hwndSelf;
/* look among siblings if we got a transparent window */ /* look among siblings if we got a transparent window */
while (pWnd && ((pWnd->dwExStyle & WS_EX_TRANSPARENT) || while (pWnd)
!(pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT))))
{ {
WIN_UpdateWndPtr(&pWnd,pWnd->next); if (!(pWnd->dwExStyle & WS_EX_TRANSPARENT) &&
} (pWnd->hrgnUpdate || (pWnd->flags & WIN_INTERNAL_PAINT)) &&
if (pWnd) GetWindowThreadProcessId( pWnd->hwndSelf, NULL ) == GetCurrentThreadId())
{ {
hwndRet = pWnd->hwndSelf; hwndRet = pWnd->hwndSelf;
WIN_ReleaseWndPtr(pWnd); WIN_ReleaseWndPtr(pWnd);
break;
}
WIN_UpdateWndPtr(&pWnd,pWnd->next);
} }
TRACE("found %04x\n",hwndRet); TRACE("found %04x\n",hwndRet);
return 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