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 <gabriel.dedietrich@theqtcompany.com>
This commit is contained in:
Timur Pocheptsov 2015-10-16 15:35:27 +02:00
parent 1901adbab7
commit 5632375b86

View File

@ -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);