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
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));
}