summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-09-11 13:05:17 +0200
committerMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-09-25 07:56:31 +0000
commit2d6f9b6148a9aa9937c293212e6e7c454cc022a7 (patch)
treefbc7577abf63916582a11518c63669aed4190c2c /src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
parent20918435b6255c119148c0d2e482aa65235ed4a1 (diff)
Cocoa: Don't send duplicate close events.
Use the presence of a platform window to detect if the QWindow has already been closed. Change-Id: Ieedf231cc5b805ed6383e55a82ca137087805a4f Task-number: QTBUG-43344 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index cac50825af..caa8884661 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -221,12 +221,8 @@ QT_END_NAMESPACE
const QWindowList topLevels = QGuiApplication::topLevelWindows();
for (int i = 0; i < topLevels.size(); ++i) {
QWindow *topLevelWindow = topLevels.at(i);
- // Widgets have alreay received a CloseEvent from the QApplication
- // QCloseEvent handler. (see canQuit above). Prevent running the
- // CloseEvent logic twice, call close() directly.
- if (topLevelWindow->inherits("QWidgetWindow"))
- topLevelWindow->close();
- else
+ // Already closed windows will not have a platform window, skip those
+ if (topLevelWindow->handle())
QWindowSystemInterface::handleCloseEvent(topLevelWindow);
}
QWindowSystemInterface::flushWindowSystemEvents();