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)