diff options
author | Morten Johan Sorvig <morten.sorvig@nokia.com> | 2012-03-21 14:58:20 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-23 09:48:04 +0100 |
commit | fd379ae7d3952cf423f87afbaed943d10e790432 (patch) | |
tree | 5d18f8ceb2bc3fc9a244030ba82e055ac1a8d2fe /src/plugins | |
parent | 96e89ddbf99f3d16869eee8fa1dcfd2a0992e674 (diff) |
Cocoa: Add window fullscreen button on OS X Lion.
Use the heuristic that windows that are not an
NSPanel and has the MaximizedButtonHint get the
fullscreen button.
Change-Id: I9a3520b7e4cd1833421d5d2f5b73da7edbfc3e74
Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index b4c4e31753..b5e8ff2246 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -382,6 +382,15 @@ NSWindow * QCocoaWindow::createNSWindow() defer:NO]; // Deferring window creation breaks OpenGL (the GL context is set up // before the window is shown and needs a proper window.). window->m_cocoaPlatformWindow = this; + +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) { + // All windows with the WindowMaximizeButtonHint set also get a full-screen button. + if (flags & Qt::WindowMaximizeButtonHint) + [window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary]; + } +#endif + createdWindow = window; } return createdWindow; |