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:
parent
dd58804cfe
commit
8ba5fe1562
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user