diff options
author | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-10-22 17:53:24 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@digia.com> | 2014-10-23 18:10:53 +0200 |
commit | 876a428f609f35dc7e9517555abd17e7c6b01693 (patch) | |
tree | ebaceb69cc195dfecd2f556a9fd505c11eab4241 /src/plugins/platforms | |
parent | 591bce8f6877ffb8e4ab81330ec077231eb2aab7 (diff) |
Cocoa: avoid sending exposes too early
Expose events trigger backing store sync and thus paint events
on QGLWidgets. Sending the exposes too early may lead to failures
in the OpenGL calls. Sending exposes before even getting to calling
setVisible(true) in QWidget::show() is just wrong.
Task-number: QTBUG-36802
Change-Id: Ic7d5125f4e257d715009811217e453d79d0fcc7c
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 9cd075fdec..4cb8fbb451 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -361,8 +361,12 @@ static NSString *_q_NSWindowDidChangeOcclusionStateNotification = nil; // Send a geometry change event to Qt, if it's ready to handle events if (!m_platformWindow->m_inConstructor) { QWindowSystemInterface::handleGeometryChange(m_window, geometry); - m_platformWindow->updateExposedGeometry(); - QWindowSystemInterface::flushWindowSystemEvents(); + // Do not send incorrect exposes in case the window is not even visible yet. + // We might get here as a result of a resize() from QWidget's show(), for instance. + if (m_platformWindow->window()->isVisible()) { + m_platformWindow->updateExposedGeometry(); + QWindowSystemInterface::flushWindowSystemEvents(); + } } } |