diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-02-13 13:57:31 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-04-17 13:29:48 +0200 |
commit | d04c9e23ff11da35f0c5784d85133cd6c65a7741 (patch) | |
tree | 1972246b073592658e46dae9ef798386dd0a4ba8 /src/plugins/platforms | |
parent | f4889e63c7b7629f9c25f42ba6c8b7852b91366f (diff) |
macOS: Activate non-modal windows during modal session if they support it
Commit 593ab638609e ensured that non-modal windows would not be activated
during a modal session, which makes sense for windows that can't be
interacted with. But some windows can, and we should activate them
as normal.
Task-number: QTBUG-46304
Change-Id: I4a9b7ec53157b042d4d6e9535336fa3254f41e0e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 79dfe58a4e..5ddbfe4377 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -376,8 +376,11 @@ void QCocoaWindow::setVisible(bool visible) } else if (window()->modality() == Qt::ApplicationModal) { // Show the window as application modal eventDispatcher()->beginModalSession(window()); - } else if (m_view.window.canBecomeKeyWindow && !eventDispatcher()->hasModalSession()) { - [m_view.window makeKeyAndOrderFront:nil]; + } else if (m_view.window.canBecomeKeyWindow) { + if (!NSApp.modalWindow || m_view.window.worksWhenModal) + [m_view.window makeKeyAndOrderFront:nil]; + else + [m_view.window orderFront:nil]; } else { [m_view.window orderFront:nil]; } |