Cocoa: Deliver window activation events synchronously

This prevents delivering queued activation events
to windows that have been hidden or destroyed.

Task-number: QTBUG-66536
Change-Id: I4edf86b6c8592751130f836876725c786452933c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This commit is contained in:
Morten Johan Sørvig 2018-01-10 14:38:20 +01:00
parent a6d1456458
commit ed4833465b

View File

@ -950,7 +950,7 @@ void QCocoaWindow::windowDidBecomeKey()
} }
if (!windowIsPopupType() && !qnsview_cast(m_view).isMenuView) if (!windowIsPopupType() && !qnsview_cast(m_view).isMenuView)
QWindowSystemInterface::handleWindowActivated(window()); QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>(window());
} }
void QCocoaWindow::windowDidResignKey() void QCocoaWindow::windowDidResignKey()
@ -968,7 +968,7 @@ void QCocoaWindow::windowDidResignKey()
if (!keyWindow || keyWindow == m_view.window) { if (!keyWindow || keyWindow == m_view.window) {
// No new key window, go ahead and set the active window to zero // No new key window, go ahead and set the active window to zero
if (!windowIsPopupType() && !qnsview_cast(m_view).isMenuView) if (!windowIsPopupType() && !qnsview_cast(m_view).isMenuView)
QWindowSystemInterface::handleWindowActivated(0); QWindowSystemInterface::handleWindowActivated<QWindowSystemInterface::SynchronousDelivery>(0);
} }
} }