diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-02-01 13:25:37 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-06 11:43:22 +0100 |
commit | 7ee4ab14636ee39670b5b25c3afa90009665eede (patch) | |
tree | 3f77af5e9015478b1d836df31e2e7c586ee974e0 /src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | |
parent | a65982d659226ace42fe0a0ca0a2f15523e95e4b (diff) |
Cocoa: Improve expose event handling.
Send expose events on window and view show/hide
notifications. Implement QCocoaWindow::isExposed.
Close all windows on quit. This allows sending (de-)expose
events for those windows while the event loop is running.
Remove the flushWindowSystemEvents call in setVisible.
This function is called from application code. Flushing
window system events here is wrong since it can lead
to events being processed in the middle of the user
code call stack. flushWindowSystemEvents should only
be called as a result of (native) window system activity.
Skip one of the tst_qtooltip tests which becomes unstable/
fails in the CI system as a result of this change.
Task-number: QTBUG-29583
Change-Id: I3fb8b3f77e2b2e19dfeafba5d7dfcef602891d37
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 55f94df45a..e756c375f3 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -202,6 +202,14 @@ static void cleanupCocoaApplicationDelegate() if ([self canQuit]) { if (!startedQuit) { startedQuit = true; + // Close open windows. This is done in order to deliver de-expose + // events while the event loop is still running. + const QWindowList topLevels = QGuiApplication::topLevelWindows(); + for (int i = 0; i < topLevels.size(); ++i) { + QWindow *window = topLevels.at(i); + topLevels.at(i)->close(); + } + QGuiApplication::exit(0); startedQuit = false; } |