From 9741fd45f734ea30e094f5b15f092b8394621204 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 23 Jul 2010 23:33:36 +0000 Subject: [PATCH] Fix MSW compilation with wxUSE_DEFERRED_SIZING==0. Add checks for wxUSE_DEFERRED_SIZING around the code using wxWindow::m_pending{Size,Position}. Closes #11348. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65066 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/toplevel.cpp | 4 ++++ src/msw/window.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index ae83dfefb1..dfb7b19ef4 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -662,6 +662,7 @@ bool wxTopLevelWindowMSW::Show(bool show) nShowCmd = SW_HIDE; } +#if wxUSE_DEFERRED_SIZING // we only set pending size if we're maximized before being shown, now that // we're shown we don't need it any more (it is reset in size event handler // for child windows but we have to do it ourselves for this parent window) @@ -671,6 +672,7 @@ bool wxTopLevelWindowMSW::Show(bool show) // them, not the size returned by WM_NCCALCSIZE in DoGetClientSize() which // turns out to be wrong for maximized windows (see #11762) m_pendingSize = wxDefaultSize; +#endif // wxUSE_DEFERRED_SIZING DoShowWindow(nShowCmd); @@ -701,6 +703,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize) // so just remember that we should do it later in this case m_maximizeOnShow = maximize; +#if wxUSE_DEFERRED_SIZING // after calling Maximize() the client code expects to get the frame // "real" size and doesn't want to know that, because of implementation // details, the frame isn't really maximized yet but will be only once @@ -718,6 +721,7 @@ void wxTopLevelWindowMSW::Maximize(bool maximize) m_pendingSize = wxGetClientDisplayRect().GetSize(); } //else: can't do anything in this case, we don't have the old size +#endif // wxUSE_DEFERRED_SIZING } } diff --git a/src/msw/window.cpp b/src/msw/window.cpp index d0cb9beda2..5dd89b0bc3 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1865,11 +1865,13 @@ void wxWindowMSW::DoGetPosition(int *x, int *y) const wxWindow * const parent = GetParent(); wxPoint pos; +#if wxUSE_DEFERRED_SIZING if ( m_pendingPosition != wxDefaultPosition ) { pos = m_pendingPosition; } else // use current position +#endif // wxUSE_DEFERRED_SIZING { RECT rect = wxGetWindowRect(GetHwnd()); -- 2.45.2