macOS: Don't update screen for child windows

Results in 'Attempt to set a screen on a child window' warning from
QWindow.

Change-Id: Ib421bada07d2085c33a4dcb62e705b2c8e2ba1c4
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
This commit is contained in:
Tor Arne Vestbø 2016-12-12 14:27:31 +01:00
parent dd58804cfe
commit 8ba5fe1562

View File

@ -2026,6 +2026,7 @@ 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
@ -2033,6 +2034,7 @@ void QCocoaWindow::exposeWindow()
// on a non-primary screen needs special handling here.
if (QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenForNSScreen(m_nsWindow.screen))
window()->setScreen(cocoaScreen->screen());
}
if (!m_isExposed) {
m_isExposed = true;