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:
@@ -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());
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user