Use window position in screen coordinates in wxDisplay::GetFromWindow().

To determine the display to which the window belongs we must use the window
position in screen coordinates returned by wxWindow::GetScreenRect() and not
the positioned returned by GetRect() which is the same only for the top level
windows but not for the child ones.

Closes #12318.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@65231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2010-08-10 18:57:42 +00:00
parent 18ff59a401
commit 5784031727

View File

@ -234,7 +234,7 @@ bool wxDisplay::ChangeMode(const wxVideoMode& mode)
int wxDisplayFactory::GetFromWindow(const wxWindow *window)
{
// consider that the window belongs to the display containing its centre
const wxRect r(window->GetRect());
const wxRect r(window->GetScreenRect());
return GetFromPoint(wxPoint(r.x + r.width/2, r.y + r.height/2));
}