From dd28827a0437782ea431ac9cf1845c4501b802b6 Mon Sep 17 00:00:00 2001 From: Jamie Gadd Date: Tue, 10 Jan 2006 21:37:16 +0000 Subject: [PATCH] Repainting fixes/improvements. Use SWP_NOCOPYBITS for statusbars, don't activate when using DeferWindowPos and remove WM_WINDOWPOSCHANGED code (no longer necessary). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36821 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/statbr95.cpp | 5 ++++- src/msw/window.cpp | 28 +++------------------------- 2 files changed, 7 insertions(+), 26 deletions(-) diff --git a/src/msw/statbr95.cpp b/src/msw/statbr95.cpp index 21dd058290..059b36a0f5 100644 --- a/src/msw/statbr95.cpp +++ b/src/msw/statbr95.cpp @@ -307,8 +307,11 @@ void wxStatusBar95::DoMoveWindow(int x, int y, int width, int height) { // parent pos/size isn't deferred so do it now but don't send // WM_WINDOWPOSCHANGING since we don't want to change pos/size later + // we must use SWP_NOCOPYBITS here otherwise it paints incorrectly + // if other windows are size deferred ::SetWindowPos(GetHwnd(), NULL, x, y, width, height, - SWP_NOZORDER | SWP_NOSENDCHANGING); + SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE | + SWP_NOCOPYBITS | SWP_NOSENDCHANGING); } // adjust fields widths to the new size diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 2ee65a51cf..a50831dea8 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1613,7 +1613,7 @@ wxWindowMSW::DoMoveSibling(WXHWND hwnd, int x, int y, int width, int height) if ( hdwp ) { hdwp = ::DeferWindowPos(hdwp, (HWND)hwnd, NULL, x, y, width, height, - SWP_NOZORDER); + SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOACTIVATE); if ( !hdwp ) { wxLogLastError(_T("DeferWindowPos")); @@ -2394,28 +2394,6 @@ WXLRESULT wxWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM l break; #endif // !__WXWINCE__ -#if !(defined(_WIN32_WCE) && _WIN32_WCE < 400) - case WM_WINDOWPOSCHANGED: - { - WINDOWPOS *lpPos = (WINDOWPOS *)lParam; - - if ( !(lpPos->flags & SWP_NOSIZE) ) - { - RECT rc; - ::GetClientRect(GetHwnd(), &rc); - - AutoHRGN hrgnClient(::CreateRectRgnIndirect(&rc)); - AutoHRGN hrgnNew(::CreateRectRgn(lpPos->x, lpPos->y, - lpPos->cx, lpPos->cy)); - - // we need to invalidate any new exposed areas here - // to force them to repaint - if ( ::CombineRgn(hrgnNew, hrgnNew, hrgnClient, RGN_DIFF) != NULLREGION ) - ::InvalidateRgn(GetHwnd(), hrgnNew, TRUE); - } - } - break; -#endif #if !defined(__WXMICROWIN__) && !defined(__WXWINCE__) case WM_ACTIVATEAPP: // This implicitly sends a wxEVT_ACTIVATE_APP event @@ -5402,12 +5380,12 @@ wxMouseState wxGetMouseState() ms.SetLeftDown( (GetAsyncKeyState(VK_LBUTTON) & (1<<15)) != 0 ); ms.SetMiddleDown( (GetAsyncKeyState(VK_MBUTTON) & (1<<15)) != 0 ); ms.SetRightDown( (GetAsyncKeyState(VK_RBUTTON) & (1<<15)) != 0 ); - + ms.SetControlDown( (GetAsyncKeyState(VK_CONTROL) & (1<<15)) != 0 ); ms.SetShiftDown( (GetAsyncKeyState(VK_SHIFT) & (1<<15)) != 0 ); ms.SetAltDown( (GetAsyncKeyState(VK_MENU) & (1<<15)) != 0 ); // ms.SetMetaDown(); - + return ms; } -- 2.45.2