comctl32: Don't get the background colour in ANIMATE_PaintFrame as this can be called inside a critical section.
This could therefore create a deadlock if the processing for WM_CTLCOLORSTATIC ends up sending certain messages to the animate control. So move the retrieval of the background colour into the callers of ANIMATE_PaintFrame but outside of any critical section.
This commit is contained in:
parent
ac61b90f87
commit
5c517a20b7
|
@ -317,9 +317,6 @@ static BOOL ANIMATE_PaintFrame(ANIMATE_INFO* infoPtr, HDC hDC)
|
||||||
rect.right = nWidth;
|
rect.right = nWidth;
|
||||||
rect.bottom = nHeight;
|
rect.bottom = nHeight;
|
||||||
|
|
||||||
infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
|
|
||||||
WM_CTLCOLORSTATIC,
|
|
||||||
(WPARAM)hDC, (LPARAM)infoPtr->hwndSelf);
|
|
||||||
if(!infoPtr->hbrushBG)
|
if(!infoPtr->hbrushBG)
|
||||||
infoPtr->hbrushBG = GetCurrentObject(hDC, OBJ_BRUSH);
|
infoPtr->hbrushBG = GetCurrentObject(hDC, OBJ_BRUSH);
|
||||||
|
|
||||||
|
@ -403,6 +400,10 @@ static DWORD CALLBACK ANIMATE_AnimationThread(LPVOID ptr_)
|
||||||
|
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
if (infoPtr->dwStyle & ACS_TRANSPARENT)
|
||||||
|
infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
|
||||||
|
WM_CTLCOLORSTATIC,
|
||||||
|
0, (LPARAM)infoPtr->hwndSelf);
|
||||||
EnterCriticalSection(&infoPtr->cs);
|
EnterCriticalSection(&infoPtr->cs);
|
||||||
ANIMATE_DrawFrame(infoPtr);
|
ANIMATE_DrawFrame(infoPtr);
|
||||||
timeout = infoPtr->mah.dwMicroSecPerFrame;
|
timeout = infoPtr->mah.dwMicroSecPerFrame;
|
||||||
|
@ -451,6 +452,10 @@ static LRESULT ANIMATE_Play(ANIMATE_INFO *infoPtr, UINT cRepeat, WORD wFrom, WOR
|
||||||
* does it send a notification */
|
* does it send a notification */
|
||||||
if (infoPtr->nFromFrame == infoPtr->nToFrame)
|
if (infoPtr->nFromFrame == infoPtr->nToFrame)
|
||||||
{
|
{
|
||||||
|
if (infoPtr->dwStyle & ACS_TRANSPARENT)
|
||||||
|
infoPtr->hbrushBG = (HBRUSH)SendMessageW(infoPtr->hwndNotify,
|
||||||
|
WM_CTLCOLORSTATIC,
|
||||||
|
0, (LPARAM)infoPtr->hwndSelf);
|
||||||
ANIMATE_DrawFrame(infoPtr);
|
ANIMATE_DrawFrame(infoPtr);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue