From 07225d48b60f88c78dd643bc7c984c3930db3544 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 2 Mar 2006 12:54:47 +0000 Subject: [PATCH] Application clipping region can be set to null without affecting paint clipping region. This fixes severe refresh problems on WinCE when clipping regions are used, and is experimental on desktop wxMSW but so far works fine. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37777 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/msw/dc.cpp b/src/msw/dc.cpp index 62d88bf832..105d5b75d3 100644 --- a/src/msw/dc.cpp +++ b/src/msw/dc.cpp @@ -483,6 +483,14 @@ void wxDC::DestroyClippingRegion() if (m_clipping && m_hDC) { +#if 1 + // On a PocketPC device (not necessarily emulator), resetting + // the clip region as per the old method causes bad display + // problems. In fact setting a null region is probably OK + // on desktop WIN32 also, since the WIN32 docs imply that the user + // clipping region is independent from the paint clipping region. + ::SelectClipRgn(GetHdc(), 0); +#else // TODO: this should restore the previous clipping region, // so that OnPaint processing works correctly, and the update // clipping region doesn't get destroyed after the first @@ -490,6 +498,7 @@ void wxDC::DestroyClippingRegion() HRGN rgn = CreateRectRgn(0, 0, 32000, 32000); ::SelectClipRgn(GetHdc(), rgn); ::DeleteObject(rgn); +#endif } wxDCBase::DestroyClippingRegion(); -- 2.45.2