Merge branch 'simplify-display'

Centralize all display-related code in wxDisplay class and avoid
duplicating or reimplementing it in wxDisplaySize() and
wxClientDisplayRect() functions.

See https://github.com/wxWidgets/wxWidgets/pull/955
This commit is contained in:
Vadim Zeitlin
2018-10-01 13:52:07 +02:00
44 changed files with 545 additions and 507 deletions

View File

@@ -1957,17 +1957,11 @@ void Window::SetTitle(const char *s) {
// Returns rectangle of monitor pt is on
PRectangle Window::GetMonitorRect(Point pt) {
wxRect rect;
if (! wid) return PRectangle();
#if wxUSE_DISPLAY
// Get the display the point is found on
int n = wxDisplay::GetFromPoint(wxPoint(wxRound(pt.x), wxRound(pt.y)));
wxDisplay dpy(n == wxNOT_FOUND ? 0 : n);
rect = dpy.GetGeometry();
#else
wxUnusedVar(pt);
#endif
return PRectangleFromwxRect(rect);
return PRectangleFromwxRect(dpy.GetGeometry());
}
//----------------------------------------------------------------------