From c08d8d5f96c369b73530f45bcac5eb98f5587054 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 2 May 2008 18:06:32 -0700 Subject: [PATCH 2/2] user32: set SWP_NOSIZE for windows with SWP_NOREDRAW. --- dlls/user32/winpos.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/user32/winpos.c b/dlls/user32/winpos.c index b325384..90c8924 100644 --- a/dlls/user32/winpos.c +++ b/dlls/user32/winpos.c @@ -1757,7 +1757,7 @@ static UINT SWP_DoNCCalcSize( WINDOWPOS* pWinpos, const RECT* pNewWindowRect, RE } /* fix redundant flags and values in the WINDOWPOS structure */ -static BOOL fixup_flags( WINDOWPOS *winpos ) +static BOOL fixup_flags( WINDOWPOS *winpos, LPRECT rect ) { HWND parent; WND *wndPtr = WIN_GetPtr( winpos->hwnd ); @@ -1794,6 +1794,10 @@ static BOOL fixup_flags( WINDOWPOS *winpos ) if ((wndPtr->rectWindow.right - wndPtr->rectWindow.left == winpos->cx) && (wndPtr->rectWindow.bottom - wndPtr->rectWindow.top == winpos->cy)) winpos->flags |= SWP_NOSIZE; /* Already the right size */ + else if (((winpos->flags & (SWP_NOREDRAW|SWP_FRAMECHANGED|SWP_NOACTIVATE)) == SWP_NOREDRAW) && + (rect->right - rect->left == winpos->cx) && + (rect->bottom - rect->top == winpos->cy)) + winpos->flags |= SWP_NOSIZE; /* Already the right size */ if ((wndPtr->rectWindow.left == winpos->x) && (wndPtr->rectWindow.top == winpos->y)) winpos->flags |= SWP_NOMOVE; /* Already the right position */ @@ -1946,7 +1950,7 @@ BOOL USER_SetWindowPos( WINDOWPOS * winpos ) if (!SWP_DoWinPosChanging( winpos, &newWindowRect, &newClientRect )) return FALSE; /* Fix redundant flags */ - if (!fixup_flags( winpos )) return FALSE; + if (!fixup_flags( winpos, &newWindowRect )) return FALSE; if((winpos->flags & (SWP_NOZORDER | SWP_HIDEWINDOW | SWP_SHOWWINDOW)) != SWP_NOZORDER) { -- 1.5.3.6