macOS: Allow moving out of fullscreen state using titlebar button

Even if the window isn't configured with Qt::WindowFullscreenButtonHint,
the user might call showFullScreen(), which we respect and move the
window into fullscreen. In this state, we need to keep the collection
behavior as NSWindowCollectionBehaviorFullScreenPrimary, otherwise the
zoom button will have no effect and the user can't move out of fullscreen.

Change-Id: I77a4b4ee4b42fabc4c6ed2f529ff57acc31d6c24
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Tor Arne Vestbø 2018-05-04 18:26:52 +02:00
parent ccfb309b90
commit 7e2177464f
1 changed files with 1 additions and 1 deletions

View File

@ -573,7 +573,7 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
Qt::WindowType type = window()->type();
if ((type & Qt::Popup) != Qt::Popup && (type & Qt::Dialog) != Qt::Dialog) {
NSWindowCollectionBehavior behavior = m_view.window.collectionBehavior;
if (flags & Qt::WindowFullscreenButtonHint) {
if ((flags & Qt::WindowFullscreenButtonHint) || m_view.window.qt_fullScreen) {
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
behavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary;
} else {