From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Tue, 14 Mar 2006 15:59:32 +0000 (+0000)
Subject: fixed centering of a TLW on a non-TLW parent
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/5a63a0f10ad035389090f718ce82b28b799684f6

fixed centering of a TLW on a non-TLW parent


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/common/toplvcmn.cpp b/src/common/toplvcmn.cpp
index c519fbc7c9..c9a8315776 100644
--- a/src/common/toplvcmn.cpp
+++ b/src/common/toplvcmn.cpp
@@ -158,8 +158,9 @@ void wxTopLevelWindowBase::DoCentre(int dir)
     wxRect rectCentre;
     if ( !(dir & wxCENTRE_ON_SCREEN) && GetParent() )
     {
-        // centre on parent window
-        rectCentre = GetParent()->GetRect();
+        // centre on parent window: notice that we need screen coordinates for
+        // positioning this TLW
+        rectCentre = GetParent()->GetScreenRect();
     }
     else
     {