summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-10-04 13:59:06 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2019-10-04 14:59:52 +0200
commitbb65ac80977c277b6cba1abee423ccfd5f1b1f4b (patch)
tree515f9d38167c9563d3be595435c1f1b111882e07 /src/plugins/platforms/cocoa
parent9a9bdebb92eda34939c8a7442f06d24ded82b799 (diff)
Modernize QWindowSystemInterface::handleCloseEvent
The base WindowSystemEvent has had an eventAccepted flag since 2014. Change-Id: Ia0aa795083cd98ece83a4c1cc010d3a25e2489fd Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 35b7162346..a744a86695 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1275,14 +1275,11 @@ void QCocoaWindow::windowWillClose()
bool QCocoaWindow::windowShouldClose()
{
qCDebug(lcQpaWindow) << "QCocoaWindow::windowShouldClose" << window();
- // This callback should technically only determine if the window
- // should (be allowed to) close, but since our QPA API to determine
- // that also involves actually closing the window we do both at the
- // same time, instead of doing the latter in windowWillClose.
- bool accepted = false;
- QWindowSystemInterface::handleCloseEvent(window(), &accepted);
- QWindowSystemInterface::flushWindowSystemEvents();
- return accepted;
+ // This callback should technically only determine if the window
+ // should (be allowed to) close, but since our QPA API to determine
+ // that also involves actually closing the window we do both at the
+ // same time, instead of doing the latter in windowWillClose.
+ return QWindowSystemInterface::handleCloseEvent<QWindowSystemInterface::SynchronousDelivery>(window());
}
// ----------------------------- QPA forwarding -----------------------------