From 825bb10d9bf40587828e4e589b199a9ffec255ce Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Fri, 4 Nov 2016 03:48:22 -0700 Subject: [PATCH] macOS: fix 32-bit builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit amends e39a436d0ca00fbcbef1428e32f74266c7a8d34d and 1ad6ae21f015ead3dcc4bed21a988f0d7d5d0d2d. Change-Id: Ib5c0b516ea2e5ec8d89f3e2e9888ef3eb8de6de4 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoaintegration.mm | 4 ++-- src/plugins/platforms/cocoa/qcocoawindow.mm | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index d48722b82f..7e9f554520 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -122,8 +122,8 @@ void QCocoaScreen::updateGeometry() // At this point the geometry is in native coordinates, but the size // is correct, which we take advantage of next when we map the native // coordinates to the Qt coordinate system. - m_geometry = QRectF::fromCGRect(m_nsScreen.frame).toRect(); - m_availableGeometry = QRectF::fromCGRect(m_nsScreen.visibleFrame).toRect(); + m_geometry = QRectF::fromCGRect(NSRectToCGRect(m_nsScreen.frame)).toRect(); + m_availableGeometry = QRectF::fromCGRect(NSRectToCGRect(m_nsScreen.visibleFrame)).toRect(); // The reference screen for the geometry is always the primary screen, but since // we may be in the process of creating and registering the primary screen, we diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index dfaed9923e..30ac79f3a0 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1662,7 +1662,7 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBeChildNSWindow, bool sh rect.translate(-targetScreen->geometry().topLeft()); QCocoaScreen *cocoaScreen = static_cast(targetScreen->handle()); - NSRect frame = cocoaScreen->mapToNative(rect).toCGRect(); + NSRect frame = NSRectFromCGRect(cocoaScreen->mapToNative(rect).toCGRect()); // Note: The macOS window manager has a bug, where if a screen is rotated, it will not allow // a window to be created within the area of the screen that has a Y coordinate (I quadrant)