summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4f2a27c2c3..72ae27cab7 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1268,6 +1268,11 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)
Class windowClass = shouldBePanel ? [QNSPanel class] : [QNSWindow class];
QCocoaNSWindow *nsWindow = [[windowClass alloc] initWithContentRect:frame
screen:cocoaScreen->nativeScreen() styleMask:windowStyleMask(flags) qPlatformWindow:this];
+ Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow",
+ "Resulting NSScreen should match the requested NSScreen");
+
+ if (targetScreen != window()->screen())
+ QWindowSystemInterface::handleWindowScreenChanged(window(), targetScreen);
nsWindow.restorable = NO;
nsWindow.level = windowLevel(flags);
@@ -1655,16 +1660,6 @@ void QCocoaWindow::exposeWindow()
if (!isWindowExposable())
return;
- if (window()->isTopLevel()) {
- // Update the QWindow's screen property. This property is set
- // to QGuiApplication::primaryScreen() at QWindow construciton
- // time, and we won't get a NSWindowDidChangeScreenNotification
- // on show. The case where the window is initially displayed
- // on a non-primary screen needs special handling here.
- if (QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenForNSScreen(m_view.window.screen))
- window()->setScreen(cocoaScreen->screen());
- }
-
if (!m_isExposed) {
m_isExposed = true;
m_exposedGeometry = geometry();