From 1c2b921a1ce6638dddeef827ea167f39dc119367 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Aug 2008 22:34:37 +0000 Subject: [PATCH] don't use our custom WM_PAINT handler with composited window as this results in an endless repaint loop (#9666); also don't even define HandlePaint() under CE as it's never used there git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@54939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/toolbar.h | 2 ++ src/msw/toolbar.cpp | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/toolbar.h b/include/wx/msw/toolbar.h index 2177278812..ce467dad50 100644 --- a/include/wx/msw/toolbar.h +++ b/include/wx/msw/toolbar.h @@ -116,7 +116,9 @@ protected: // handlers for various events bool HandleSize(WXWPARAM wParam, WXLPARAM lParam); +#ifndef __WXWINCE__ bool HandlePaint(WXWPARAM wParam, WXLPARAM lParam); +#endif // __WXWINCE__ void HandleMouseMove(WXWPARAM wParam, WXLPARAM lParam); // should be called whenever the toolbar size changes diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 33c4950b30..58490dcdc7 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1859,12 +1859,14 @@ WXLRESULT wxToolBar::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam #ifndef __WXWINCE__ case WM_PAINT: - if ( HandlePaint(wParam, lParam) ) + // refreshing the controls in the toolbar inside a composite window + // results in an endless stream of WM_PAINT messages -- and seems + // to be unnecessary anyhow as everything works just fine without + // any special workarounds in this case + if ( !IsDoubleBuffered() && HandlePaint(wParam, lParam) ) return 0; -#endif - - default: break; +#endif // __WXWINCE__ } return wxControl::MSWWindowProc(nMsg, wParam, lParam); -- 2.45.2