summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2013-09-24 15:59:21 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-24 17:48:13 +0200
commit6cdd9928ab3de3c84b39b8b2d395f139fbf9aba2 (patch)
tree881fee818eb47726eb2c42b9987a1feab000c60d /src/plugins
parentd25eead30f08ccc0763d63bffdc83ba1e1a6cb91 (diff)
downloadqtbase-6cdd9928ab3de3c84b39b8b2d395f139fbf9aba2.tar.gz
Cocoa: Use internal style mask to disable resizing popup parents
Using QCocoaWindow::windowStyleMask() resets some private flags Cocoa sets when showing sheets. Task-number: QTBUG-33126 Change-Id: I34f0713f98e81e7010b0b7620ee24ea30f04dcff Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm14
2 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h
index 8967445f59..05bf657c1f 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.h
+++ b/src/plugins/platforms/cocoa/qcocoawindow.h
@@ -200,6 +200,7 @@ public: // for QNSView
bool m_frameStrutEventsEnabled;
bool m_isExposed;
int m_registerTouchCount;
+ bool m_resizableTransientParent;
static const int NoAlertRequest;
NSInteger m_alertRequest;
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 5fc2975a9d..671214f424 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -211,6 +211,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
, m_frameStrutEventsEnabled(false)
, m_isExposed(false)
, m_registerTouchCount(0)
+ , m_resizableTransientParent(false)
, m_alertRequest(NoAlertRequest)
{
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
@@ -317,12 +318,14 @@ 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
+ NSUInteger parentStyleMask = [parentCocoaWindow->m_nsWindow styleMask];
+ if ((m_resizableTransientParent = (parentStyleMask & NSResizableWindowMask))
#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))
+ && QSysInfo::QSysInfo::MacintoshVersion >= QSysInfo::MV_10_7
+ && !([parentCocoaWindow->m_nsWindow styleMask] & NSFullScreenWindowMask)
#endif
- [parentCocoaWindow->m_nsWindow setStyleMask:
- (parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags) & ~NSResizableWindowMask)];
+ )
+ [parentCocoaWindow->m_nsWindow setStyleMask:parentStyleMask & ~NSResizableWindowMask];
}
}
@@ -398,13 +401,14 @@ void QCocoaWindow::setVisible(bool visible)
[m_contentView setHidden:YES];
}
if (parentCocoaWindow && window()->type() == Qt::Popup
+ && m_resizableTransientParent
#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)];
+ [parentCocoaWindow->m_nsWindow setStyleMask:[parentCocoaWindow->m_nsWindow styleMask] | NSResizableWindowMask];
}
}