diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-02-19 11:14:53 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2019-02-20 01:30:01 +0000 |
commit | 2fc4635e9889ade1ae79b787cc18aae654e65e3b (patch) | |
tree | bc39b762a18c6584e268d95501e484e6f16a1f82 /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 4c759340081384e7b9fae5d2179d25016dc1dda6 (diff) |
macOS: Remove special handling for hiding tool windows on application hide
The code was needed when we had QCocoaWindow::hide(), that guarded the
ordering out by checking the visible state of the NSWindow. We no longer
have that method, and setVisible doesn't have the same guard.
Added a comment in setVisible to prevent future travelers from adding
logic that introduces the same situation.
Change-Id: I0514619a303daceb1cd7d334f0de4bfce6c3e96f
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
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 | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d1047e1965..50adbad518 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -400,6 +400,11 @@ void QCocoaWindow::setVisible(bool visible) } } + // Note: We do not guard the order out by checking NSWindow.visible, as AppKit will + // in some cases, such as when hiding the application, order out and make a window + // invisible, but keep it in a list of "hidden windows", that it then restores again + // when the application is unhidden. We need to call orderOut explicitly, to bring + // the window out of this "hidden list". [m_view.window orderOut:nil]; if (m_view.window == [NSApp keyWindow] && !eventDispatcher()->hasModalSession()) { |