[Win32SS]

- HAX : Fix paint message spam. See CORE-12169 and related issues.

svn path=/trunk/; revision=73372
This commit is contained in:
James Tabor 2016-11-24 18:18:28 +00:00
parent fbf2c84e20
commit 03c1491725
3 changed files with 33 additions and 2 deletions

View file

@ -789,8 +789,8 @@ IntDispatchMessage(PMSG pMsg)
{
Window->state2 &= ~WNDS2_WMPAINTSENT;
/* send a WM_ERASEBKGND if the non-client area is still invalid */
ERR("Message WM_PAINT\n");
co_IntPaintWindows( Window, RDW_NOCHILDREN, FALSE );
ERR("Message WM_PAINT count %d Internal Paint Set? %s\n",Window->head.pti->cPaintsReady, Window->state & WNDS_INTERNALPAINT ? "TRUE" : "FALSE");
IntPaintWindow( Window );
}
return retval;

View file

@ -1157,6 +1157,36 @@ IntFindWindowToRepaint(PWND Window, PTHREADINFO Thread)
return Window;
}
//
// Hax around internal painting of windows.
//
VOID FASTCALL
IntPaintWindow( PWND Window )
{
// Handle normal painting.
co_IntPaintWindows( Window, RDW_NOCHILDREN, FALSE );
// Hack to prevent more spamming from misbehaving application.
// Handle it like a begin/end paint
if (Window->hrgnUpdate != NULL)
{
ERR("HAX hrgnUpdate not NULL! Dec Paint Count!\n");
MsqDecPaintCountQueue(Window->head.pti);
IntGdiSetRegionOwner(Window->hrgnUpdate, GDI_OBJ_HMGR_POWNED);
GreDeleteObject(Window->hrgnUpdate);
Window->state &= ~WNDS_UPDATEDIRTY;
Window->hrgnUpdate = NULL;
}
else
{
if (!(Window->state & WNDS_INTERNALPAINT))
{
ERR("HAX WNDS_INTERNALPAINT not set! Dec Paint Count!\n");
MsqDecPaintCountQueue(Window->head.pti);
}
}
}
BOOL FASTCALL
IntGetPaintMessage(
PWND Window,

View file

@ -40,3 +40,4 @@ BOOL FASTCALL IntIsWindowDrawable(PWND);
BOOL UserDrawCaption(PWND,HDC,RECTL*,HFONT,HICON,const PUNICODE_STRING,UINT);
VOID FASTCALL UpdateThreadWindows(PWND,PTHREADINFO,HRGN);
VOID FASTCALL UserSyncAndPaintWindows(PWND pWnd, ULONG Flags);
VOID FASTCALL IntPaintWindow(PWND);