win32ss/user/ntuser/painting.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win32ss/user/ntuser/painting.c b/win32ss/user/ntuser/painting.c index 6edf47699fc..a013269db0e 100644 --- a/win32ss/user/ntuser/painting.c +++ b/win32ss/user/ntuser/painting.c @@ -819,8 +819,8 @@ IntInvalidateWindows(PWND Wnd, PREGION Rgn, ULONG Flags) Wnd->state &= ~(WNDS_SENDERASEBACKGROUND|WNDS_ERASEBACKGROUND); } } - - if (HadPaintMessage && !IntIsWindowDirty(Wnd)) + /* If invalidating during a WM_PAINT message, decrement paint count */ + if ((Wnd->state & WNDS_PAINTNOTPROCESSED) || (HadPaintMessage && !IntIsWindowDirty(Wnd))) { MsqDecPaintCountQueue(Wnd->head.pti); }