From c12b6075d18280dc0405f3d19be4492ed1ebe560 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 20 Oct 2016 03:31:06 -0700 Subject: [PATCH] Update main/primary screen term usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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ø Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoahelpers.mm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoahelpers.mm b/src/plugins/platforms/cocoa/qcocoahelpers.mm index c57567bdd6..f290275b5e 100644 --- a/src/plugins/platforms/cocoa/qcocoahelpers.mm +++ b/src/plugins/platforms/cocoa/qcocoahelpers.mm @@ -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)