From 0d7f75df793b32c7ff6e28c83792ab3f8eafe46e Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 Jan 2006 22:07:44 +0000 Subject: [PATCH] return correct client size for child window which are being defer-resized git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/window.cpp | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/msw/window.cpp b/src/msw/window.cpp index 140dd8f88d..e7129e32d5 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -1511,14 +1511,24 @@ void wxWindowMSW::DoGetSize(int *x, int *y) const // Get size *available for subwindows* i.e. excluding menu bar etc. void wxWindowMSW::DoGetClientSize(int *x, int *y) const { - // this is only for top level windows whose resizing is never deferred, so - // we can safely use the current size here - RECT rect = wxGetClientRect(GetHwnd()); + if ( IsTopLevel() || m_pendingSize == wxDefaultSize ) + { + // 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 ( x ) + *x = rect.right; + if ( y ) + *y = rect.bottom; + } + else // non top level + { + // 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); + } } void wxWindowMSW::DoGetPosition(int *x, int *y) const -- 2.45.2