Created
November 27, 2013 12:35
-
-
Save zenoalbisser/7674949 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 39ec0f0a484448b541eb0050a001fafee6a5f637 | |
Author: Zeno Albisser <zeno.albisser@digia.com> | |
Date: Wed Nov 27 13:34:55 2013 +0100 | |
Allow resetting Qt::WindowFullscreenButtonHint | |
Currently Qt::WindowFulscreenButtonHint is only | |
respected on window creation. But flags | |
can also be adjusted later on. | |
Change-Id: I507d6fde5ad2f0ee5b9db322325ede99b70e151e | |
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm | |
index 228ef9d..f64655f 100644 | |
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm | |
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm | |
@@ -522,6 +522,17 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) | |
if (!(styleMask & NSBorderlessWindowMask)) { | |
setWindowTitle(window()->title()); | |
} | |
+ | |
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 | |
+ if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { | |
+ NSWindowCollectionBehavior behavior = [m_nsWindow collectionBehavior]; | |
+ if (flags & Qt::WindowFullscreenButtonHint) | |
+ behavior |= NSWindowCollectionBehaviorFullScreenPrimary; | |
+ else | |
+ behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary; | |
+ [m_nsWindow setCollectionBehavior:behavior]; | |
+ } | |
+#endif | |
} | |
m_windowFlags = flags; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment