From 8d12e074532e2845d2512be8a103049713c681ec Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 27 Dec 2014 14:24:46 +0000 Subject: [PATCH] Fix flickering when resizing a frame with status bar in wxMSW. The flicker was only visible under Windows XP or when using a class theme and was due to mis-positioning the status bar initially in PositionStatusBar(). Fix this by adjusting its position by the toolbar offset before calling its SetSize(). Closes #16705. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78325 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/frame.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/msw/frame.cpp b/src/msw/frame.cpp index 078888b33c..db34ad48ff 100644 --- a/src/msw/frame.cpp +++ b/src/msw/frame.cpp @@ -331,16 +331,6 @@ void wxFrame::PositionStatusBar() int w, h; GetClientSize(&w, &h); - // Resize the status bar to its default height, as it could have been set - // to a wrong value before by WM_SIZE sent during the frame creation and - // our status bars preserve their programmatically set size to avoid being - // resized by DefWindowProc() to the full window width, so if we didn't do - // this here, the status bar would retain the possibly wrong current height. - m_frameStatusBar->SetSize(wxDefaultSize, wxSIZE_AUTO_HEIGHT); - - int sw, sh; - m_frameStatusBar->GetSize(&sw, &sh); - int x = 0; #if wxUSE_TOOLBAR wxToolBar * const toolbar = GetToolBar(); @@ -364,6 +354,16 @@ void wxFrame::PositionStatusBar() //else: no adjustments necessary for the toolbar on top #endif // wxUSE_TOOLBAR + // Resize the status bar to its default height, as it could have been set + // to a wrong value before by WM_SIZE sent during the frame creation and + // our status bars preserve their programmatically set size to avoid being + // resized by DefWindowProc() to the full window width, so if we didn't do + // this here, the status bar would retain the possibly wrong current height. + m_frameStatusBar->SetSize(x, h, w, wxDefaultCoord, wxSIZE_AUTO_HEIGHT); + + int sw, sh; + m_frameStatusBar->GetSize(&sw, &sh); + // Since we wish the status bar to be directly under the client area, // we use the adjusted sizes without using wxSIZE_NO_ADJUSTMENTS. m_frameStatusBar->SetSize(x, h, w, sh);