From 926086b9e37d45d09d5ce7d632a07583b40a8f70 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Thu, 18 Apr 2013 16:50:19 +0200 Subject: [PATCH] Cocoa: Disable QTBUG-30266 hack in full screen That would set the full screen window in a weird state, where is was full screen (but unable to exit that mode) and showing the title bar at the same time. Change-Id: I3ac913876f3b326504dd5af18c34181d002509d0 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/cocoa/qcocoawindow.mm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index c5babae19e..5ff1bf83ae 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -283,6 +283,10 @@ void QCocoaWindow::setVisible(bool visible) parentCocoaWindow->m_activePopupWindow = window(); // QTBUG-30266: a window should not be resizable while a transient popup is open // Since this isn't a native popup, the window manager doesn't close the popup when you click outside +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + if (QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7 + && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask)) +#endif [parentCocoaWindow->m_nsWindow setStyleMask: (parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags) & ~NSResizableWindowMask)]; } @@ -346,7 +350,12 @@ void QCocoaWindow::setVisible(bool visible) } else { [m_contentView setHidden:YES]; } - if (parentCocoaWindow && window()->type() == Qt::Popup) + if (parentCocoaWindow && window()->type() == Qt::Popup +#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 + && QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7 + && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask) +#endif + ) // QTBUG-30266: a window should not be resizable while a transient popup is open [parentCocoaWindow->m_nsWindow setStyleMask:parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags)]; }