From d50b6ab0ac25ece7981e8115c70db131e4b0a4c8 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 1 May 2008 23:43:40 -0700 Subject: [PATCH] user32: only send WM_SIZE if the window size actually changed. --- dlls/user32/defwnd.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/dlls/user32/defwnd.c b/dlls/user32/defwnd.c index ba07ebb..2c53e04 100644 --- a/dlls/user32/defwnd.c +++ b/dlls/user32/defwnd.c @@ -56,9 +56,11 @@ static const WCHAR imm32W[] = { 'i','m','m','3','2','\0' }; static void DEFWND_HandleWindowPosChanged( HWND hwnd, const WINDOWPOS *winpos ) { RECT rect; + RECT rect_win; WND *wndPtr = WIN_GetPtr( hwnd ); rect = wndPtr->rectClient; + rect_win = wndPtr->rectWindow; WIN_ReleasePtr( wndPtr ); if (!(winpos->flags & SWP_NOCLIENTMOVE)) @@ -70,7 +72,10 @@ static void DEFWND_HandleWindowPosChanged( HWND hwnd, const WINDOWPOS *winpos ) if (IsZoomed(hwnd)) wp = SIZE_MAXIMIZED; else if (IsIconic(hwnd)) wp = SIZE_MINIMIZED; - SendMessageW( hwnd, WM_SIZE, wp, MAKELONG(rect.right-rect.left, rect.bottom-rect.top) ); + /* only send if the size has actually changed */ + if ((rect_win.right-rect_win.left != winpos->cx) || + (rect_win.bottom-rect_win.top != winpos->cy)) + SendMessageW( hwnd, WM_SIZE, wp, MAKELONG(rect.right-rect.left, rect.bottom-rect.top) ); } } -- 1.5.2.2