From 5632375b86f467177b7cd326d2e194692753f4a6 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Fri, 16 Oct 2015 15:35:27 +0200 Subject: [PATCH] Cocoa integration - fix Qt::WindowFullscreenButtonHint Window collection behavior changed from OS X <= 10.9 to 10.10 to 10.11: - the default behavior (0) included fullscreen button before 10.10, did not include in 10.10, and now it's again included. - it's not enough to exclude fullscreen - since the defualt is 0, 0 & ~fullscreen does not help - we also have to set fullscreen auxiliary. Task-number: QTBUG-48759 Change-Id: If427bd5cfa5c3cefc71f09dae7baa0d232601ee4 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 6f1e355790..a545dbddd5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -885,10 +885,13 @@ 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_nsWindow collectionBehavior]; - if (flags & Qt::WindowFullscreenButtonHint) + if (flags & Qt::WindowFullscreenButtonHint) { behavior |= NSWindowCollectionBehaviorFullScreenPrimary; - else + behavior &= ~NSWindowCollectionBehaviorFullScreenAuxiliary; + } else { + behavior |= NSWindowCollectionBehaviorFullScreenAuxiliary; behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; + } [m_nsWindow setCollectionBehavior:behavior]; } setWindowZoomButton(flags);