As wxWindow doesn't have an associated HWND when using wxGTK, use
MonitorFromPoint() instead of MonitorFromWindow() for this port.
Closes #14408.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@71912
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
int wxDisplayFactoryMSW::GetFromWindow(const wxWindow *window)
{
+#ifdef __WXMSW__
return FindDisplayFromHMONITOR(gs_MonitorFromWindow(GetHwndOf(window),
MONITOR_DEFAULTTONULL));
+#else
+ const wxSize halfsize = window->GetSize() / 2;
+ wxPoint pt = window->GetScreenPosition();
+ pt.x += halfsize.x;
+ pt.y += halfsize.y;
+ return GetFromPoint(pt);
+#endif
}
#endif // wxUSE_DISPLAY