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>
bb10
Morten Johan Sorvig 2012-03-21 14:58:20 +01:00 committed by Qt by Nokia
parent 96e89ddbf9
commit fd379ae7d3
1 changed files with 9 additions and 0 deletions

View File

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