Allow resetting Qt::WindowFullscreenButtonHint
Currently Qt::WindowFulscreenButtonHint is only respected on window creation. But flags can also be adjusted later on. Further setWindowShadow can be removed from within createNSWindow, as it operates on a Nil object in that case. It is however called by recreateWindow / setWindowFlags subsequently. Change-Id: I507d6fde5ad2f0ee5b9db322325ede99b70e151e Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
95ffd606f8
commit
ca73f493a1
@ -522,6 +522,20 @@ 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) {
|
||||
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)
|
||||
behavior |= NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
else
|
||||
behavior &= ~NSWindowCollectionBehaviorFullScreenPrimary;
|
||||
[m_nsWindow setCollectionBehavior:behavior];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
m_windowFlags = flags;
|
||||
@ -871,8 +885,6 @@ NSWindow * QCocoaWindow::createNSWindow()
|
||||
// before the window is shown and needs a proper window.).
|
||||
if ((type & Qt::Popup) == Qt::Popup)
|
||||
[window setHasShadow:YES];
|
||||
else
|
||||
setWindowShadow(flags);
|
||||
[window setHidesOnDeactivate: NO];
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
@ -894,14 +906,6 @@ 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;
|
||||
setWindowShadow(flags);
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
|
||||
if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7) {
|
||||
if (flags & Qt::WindowFullscreenButtonHint)
|
||||
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
}
|
||||
#endif
|
||||
|
||||
createdWindow = window;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user