macOS: Correctly restart display-link when window is moved between screens
Change-Id: I4b9cdd3d259965f9094ef1bbbca3ebed8df18443 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
97e88dcb92
commit
d6fb64267f
@ -1070,10 +1070,12 @@ void QCocoaWindow::windowDidChangeScreen()
|
|||||||
if (!window())
|
if (!window())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
const bool wasRunningDisplayLink = static_cast<QCocoaScreen *>(screen())->isRunningDisplayLink();
|
||||||
|
|
||||||
if (QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenForNSScreen(m_view.window.screen)) {
|
if (QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenForNSScreen(m_view.window.screen)) {
|
||||||
QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::SynchronousDelivery>(window(), cocoaScreen->screen());
|
QWindowSystemInterface::handleWindowScreenChanged<QWindowSystemInterface::SynchronousDelivery>(window(), cocoaScreen->screen());
|
||||||
|
|
||||||
if (hasPendingUpdateRequest() && cocoaScreen->isRunningDisplayLink())
|
if (hasPendingUpdateRequest() && wasRunningDisplayLink)
|
||||||
requestUpdate(); // Restart display-link on new screen
|
requestUpdate(); // Restart display-link on new screen
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user