summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm15
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm1
2 files changed, 12 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 9466b68bec..a346dc9d4d 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -261,6 +261,9 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
void QCocoaWindow::setVisible(bool visible)
{
QCocoaAutoReleasePool pool;
+ QCocoaWindow *parentCocoaWindow = 0;
+ if (window()->transientParent())
+ parentCocoaWindow = static_cast<QCocoaWindow *>(window()->transientParent()->handle());
#ifdef QT_COCOA_ENABLE_WINDOW_DEBUG
qDebug() << "QCocoaWindow::setVisible" << window() << visible;
#endif
@@ -268,10 +271,7 @@ void QCocoaWindow::setVisible(bool visible)
// We need to recreate if the modality has changed as the style mask will need updating
if (m_windowModality != window()->modality())
recreateWindow(parent());
- QCocoaWindow *parentCocoaWindow = 0;
- if (window()->transientParent()) {
- parentCocoaWindow = static_cast<QCocoaWindow *>(window()->transientParent()->handle());
-
+ if (parentCocoaWindow) {
// The parent window might have moved while this window was hidden,
// update the window geometry if there is a parent.
setGeometry(window()->geometry());
@@ -281,6 +281,10 @@ void QCocoaWindow::setVisible(bool visible)
if (window()->type() == Qt::Popup) {
// qDebug() << "transientParent and popup" << window()->type() << Qt::Popup << (window()->type() & Qt::Popup);
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
+ [parentCocoaWindow->m_nsWindow setStyleMask:
+ (parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags) & ~NSResizableWindowMask)];
}
}
@@ -342,6 +346,9 @@ void QCocoaWindow::setVisible(bool visible)
} else {
[m_contentView setHidden:YES];
}
+ if (parentCocoaWindow && window()->type() == Qt::Popup)
+ // QTBUG-30266: a window should not be resizable while a transient popup is open
+ [parentCocoaWindow->m_nsWindow setStyleMask:parentCocoaWindow->windowStyleMask(parentCocoaWindow->m_windowFlags)];
}
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index e608731cc1..d937ae4507 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -241,6 +241,7 @@ static QTouchDevice *touchDevice = 0;
// Send a geometry change event to Qt, if it's ready to handle events
if (!m_platformWindow->m_inConstructor) {
QWindowSystemInterface::handleGeometryChange(m_window, geometry);
+ QWindowSystemInterface::handleExposeEvent(m_window, geometry);
QWindowSystemInterface::flushWindowSystemEvents();
}
}