]> git.saurik.com Git - wxWidgets.git/commitdiff
Calculate correct client size for windows that are using deferred sizing.
authorJamie Gadd <jrgadd2@cs.latrobe.edu.au>
Wed, 25 Jan 2006 23:40:20 +0000 (23:40 +0000)
committerJamie Gadd <jrgadd2@cs.latrobe.edu.au>
Wed, 25 Jan 2006 23:40:20 +0000 (23:40 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37145 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/window.cpp

index 8aa92e8e2f3c8668fdaf84b062ac06126febd89b..c7ecb7bce4ba48f38142c0a52ecec5f4e6a2a0b4 100644 (file)
@@ -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;
     }
 }