diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2016-12-12 14:27:31 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2017-01-04 13:16:45 +0000 |
commit | 8ba5fe15623bb777cf7fa3768a4b87052d36ccde (patch) | |
tree | 02ccbe7490003c7cc1372da09109f81bc46be88c /src/plugins/platforms/cocoa | |
parent | dd58804cfe691ac356e9d3d6f29840bb0725974c (diff) |
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>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c8f890a11c..c2f0122243 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -2026,13 +2026,15 @@ void QCocoaWindow::exposeWindow() if (!isWindowExposable()) return; - // 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_nsWindow.screen)) - window()->setScreen(cocoaScreen->screen()); + 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_nsWindow.screen)) + window()->setScreen(cocoaScreen->screen()); + } if (!m_isExposed) { m_isExposed = true; |