From 0d6fdb3cbda95ec940b9675bfcc4685e693a4738 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 1 Jul 2006 14:19:41 +0000 Subject: [PATCH] use WM_NCCALCSIZE in DoGetClientSize() if the window has deferred size, even if it's toplevel git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@39919 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index f48f1869ed..2a8c8e3082 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1567,6 +1567,7 @@ bool wxWindowMSW::IsSizeDeferred() const // Get total size void wxWindowMSW::DoGetSize(int *x, int *y) const { +#if USE_DEFERRED_SIZING // if SetSize() had been called at wx level but not realized at Windows // level yet (i.e. EndDeferWindowPos() not called), we still should return // the new and not the old position to the other wx code @@ -1578,6 +1579,7 @@ void wxWindowMSW::DoGetSize(int *x, int *y) const *y = m_pendingSize.y; } else // use current size +#endif // USE_DEFERRED_SIZING { RECT rect = wxGetWindowRect(GetHwnd()); @@ -1592,21 +1594,9 @@ void wxWindowMSW::DoGetSize(int *x, int *y) const void wxWindowMSW::DoGetClientSize(int *x, int *y) const { #if USE_DEFERRED_SIZING - if ( IsTopLevel() || m_pendingSize == wxDefaultSize ) -#endif - { // top level windows resizing is never deferred, so we can safely use - // the current size here - RECT rect = wxGetClientRect(GetHwnd()); - - if ( x ) - *x = rect.right; - if ( y ) - *y = rect.bottom; - } -#if USE_DEFERRED_SIZING - else // non top level and using deferred sizing + if ( m_pendingSize != wxDefaultSize ) { - // we need to calculate the *pending* client size here + // we need to calculate the client size corresponding to pending size RECT rect; rect.left = m_pendingPosition.x; rect.top = m_pendingPosition.y; @@ -1620,7 +1610,16 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const if ( y ) *y = rect.bottom - rect.top; } -#endif + else +#endif // USE_DEFERRED_SIZING + { + RECT rect = wxGetClientRect(GetHwnd()); + + if ( x ) + *x = rect.right; + if ( y ) + *y = rect.bottom; + } } void wxWindowMSW::DoGetPosition(int *x, int *y) const -- 2.45.2