macOS: Deliver focus change events for foreign windows
If a foreign window becomes or loses focus window status, we should let QGuiApplication know about it. Pick-to: 6.7 Task-number: QTBUG-119287 Change-Id: I550d72fa13e1c38c9b89880857db9f9cbd7f6568 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>bb10
parent
cf9b143cb3
commit
75a5605151
|
|
@ -1246,16 +1246,13 @@ void QCocoaWindow::windowDidEndLiveResize()
|
|||
|
||||
void QCocoaWindow::windowDidBecomeKey()
|
||||
{
|
||||
if (isForeignWindow())
|
||||
return;
|
||||
|
||||
// The NSWindow we're part of become key. Check if we're the first
|
||||
// responder, and if so, deliver focus window change to our window.
|
||||
if (m_view.window.firstResponder != m_view)
|
||||
return;
|
||||
|
||||
qCDebug(lcQpaWindow) << m_view.window << "became key window."
|
||||
<< "Updating focus window to" << this;
|
||||
<< "Updating focus window to" << this << "with view" << m_view;
|
||||
|
||||
if (windowIsPopupType()) {
|
||||
qCDebug(lcQpaWindow) << "Window is popup. Skipping focus window change.";
|
||||
|
|
@ -1269,16 +1266,13 @@ void QCocoaWindow::windowDidBecomeKey()
|
|||
|
||||
void QCocoaWindow::windowDidResignKey()
|
||||
{
|
||||
if (isForeignWindow())
|
||||
return;
|
||||
|
||||
// The NSWindow we're part of lost key. Check if we're the first
|
||||
// responder, and if so, deliver window deactivation to our window.
|
||||
if (m_view.window.firstResponder != m_view)
|
||||
return;
|
||||
|
||||
qCDebug(lcQpaWindow) << m_view.window << "resigned key window."
|
||||
<< "Clearing focus window" << this;
|
||||
<< "Clearing focus window" << this << "with view" << m_view;
|
||||
|
||||
// Make sure popups are closed before we deliver activation changes, which are
|
||||
// otherwise ignored by QApplication.
|
||||
|
|
|
|||
Loading…
Reference in New Issue