Update main/primary screen term usage

The first screen in the screens array is referred to
as the _primary_ screen in Apple documentation.

The main screen is the screen with the currently active
window.

Change-Id: I900a53e6bfb06ed9e42fba1e11d3a583777e9a1d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
bb10
Morten Johan Sørvig 2016-10-20 03:31:06 -07:00
parent bd603b2eb8
commit c12b6075d1
1 changed files with 5 additions and 5 deletions

View File

@ -235,13 +235,13 @@ QString qt_mac_applicationName()
return appName;
}
int qt_mac_mainScreenHeight()
int qt_mac_primaryScreenHeight()
{
QMacAutoReleasePool pool;
NSArray *screens = [NSScreen screens];
if ([screens count] > 0) {
// The first screen in the screens array is documented
// to have the (0,0) origin.
// The first screen in the screens array is documented to
// have the (0,0) origin and is designated the primary screen.
NSRect screenFrame = [[screens objectAtIndex: 0] frame];
return screenFrame.size.height;
}
@ -250,12 +250,12 @@ int qt_mac_mainScreenHeight()
int qt_mac_flipYCoordinate(int y)
{
return qt_mac_mainScreenHeight() - y;
return qt_mac_primaryScreenHeight() - y;
}
qreal qt_mac_flipYCoordinate(qreal y)
{
return qt_mac_mainScreenHeight() - y;
return qt_mac_primaryScreenHeight() - y;
}
QPointF qt_mac_flipPoint(const NSPoint &p)