diff options
author | Volker Hilsheimer <volker.hilsheimer@qt.io> | 2020-04-28 17:22:53 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-04-29 22:28:56 +0000 |
commit | 1337e8fe46ac7934f80b8a95b84b5cb61707f8e4 (patch) | |
tree | afcab092c06f4745508dae058beb4b368c90abc6 /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 062b50abff6a3cb2319ade41dddf76caa36f27e3 (diff) |
macOS/iOS: set focus reason when handling window deactivation
Otherwise, the focusOutEvent to e.g. a QQuickItem losting focus will
be OtherFocusReason when the window it's becomes inactive.
Task-number: QTBUG-70319
Change-Id: Ic3762e68d92a88becd2b35612b14f6af64ee934e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index f387c0d093..e471d2af28 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1199,7 +1199,8 @@ void QCocoaWindow::windowDidBecomeKey() } if (!windowIsPopupType()) - QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>(window()); + QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>( + window(), Qt::ActiveWindowFocusReason); } void QCocoaWindow::windowDidResignKey() @@ -1217,7 +1218,8 @@ void QCocoaWindow::windowDidResignKey() if (!keyWindow || keyWindow == m_view.window) { // No new key window, go ahead and set the active window to zero if (!windowIsPopupType()) - QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>(0); + QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>( + nullptr, Qt::ActiveWindowFocusReason); } } |