From dc497201eb08e3de1402480e2ab97a6405335ecb Mon Sep 17 00:00:00 2001 From: Jamie Gadd Date: Wed, 25 Jan 2006 23:40:20 +0000 Subject: [PATCH] Calculate correct client size for windows that are using deferred sizing. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 8aa92e8e2f..c7ecb7bce4 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1512,12 +1512,21 @@ void wxWindowMSW::DoGetClientSize(int *x, int *y) const if ( y ) *y = rect.bottom; } - else // non top level + else // non top level and using deferred sizing { - // size is the same as client size for non top level windows, so - // forward to GetSize() to take into account deferred sizing (which - // wxGetClientRect() doesn't) - DoGetSize(x, y); + // we need to calculate the *pending* client size here + RECT rect; + rect.left = m_pendingPosition.x; + rect.top = m_pendingPosition.y; + rect.right = rect.left + m_pendingSize.x; + rect.bottom = rect.top + m_pendingSize.y; + + ::SendMessage(GetHwnd(), WM_NCCALCSIZE, FALSE, (LPARAM)&rect); + + if ( x ) + *x = rect.right - rect.left; + if ( y ) + *y = rect.bottom - rect.top; } } -- 2.45.2