Cocoa: Send expose event on screen change.
Required to repaint OpenGL content properly. Task-number: QTBUG-38105 Change-Id: Ie9441d56bd9d1a4eb399210369592f03e19c4929 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
This commit is contained in:
parent
78af725907
commit
bab494e4d0
@ -272,6 +272,7 @@ public: // for QNSView
|
||||
bool m_geometryUpdateExposeAllowed;
|
||||
bool m_isExposed;
|
||||
QRect m_exposedGeometry;
|
||||
qreal m_exposedDevicePixelRatio;
|
||||
int m_registerTouchCount;
|
||||
bool m_resizableTransientParent;
|
||||
bool m_hiddenByClipping;
|
||||
|
@ -1710,6 +1710,7 @@ void QCocoaWindow::exposeWindow()
|
||||
if (!m_isExposed) {
|
||||
m_isExposed = true;
|
||||
m_exposedGeometry = geometry();
|
||||
m_exposedDevicePixelRatio = devicePixelRatio();
|
||||
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
|
||||
}
|
||||
}
|
||||
@ -1735,11 +1736,12 @@ void QCocoaWindow::updateExposedGeometry()
|
||||
if (!isWindowExposable())
|
||||
return;
|
||||
|
||||
if (m_exposedGeometry == geometry())
|
||||
if (m_exposedGeometry == geometry() && m_exposedDevicePixelRatio == devicePixelRatio())
|
||||
return;
|
||||
|
||||
m_isExposed = true;
|
||||
m_exposedGeometry = geometry();
|
||||
m_exposedDevicePixelRatio = devicePixelRatio();
|
||||
QWindowSystemInterface::handleExposeEvent(window(), QRegion(geometry()));
|
||||
}
|
||||
|
||||
|
@ -329,6 +329,7 @@ static QTouchDevice *touchDevice = 0;
|
||||
if (m_window) {
|
||||
NSUInteger screenIndex = [[NSScreen screens] indexOfObject:self.window.screen];
|
||||
if (screenIndex != NSNotFound) {
|
||||
m_platformWindow->updateExposedGeometry();
|
||||
QCocoaScreen *cocoaScreen = QCocoaIntegration::instance()->screenAtIndex(screenIndex);
|
||||
QWindowSystemInterface::handleWindowScreenChanged(m_window, cocoaScreen->screen());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user