diff options
author | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:36:18 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-11-10 11:38:40 +0100 |
commit | 58437fb125f60c11ba8e97c914fa8db8c89c7373 (patch) | |
tree | f47ed59073984ec76034155bc04d3d987b192d2e /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 76bb804405f424708fffec502788995ea91206b8 (diff) | |
parent | b20c15f2041205a1cab98fbaf9560a3e2e0d6367 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/serialization/qcborcommon.h
src/corelib/tools/qlocale_data_p.h
tests/auto/network/ssl/qsslsocket/tst_qsslsocket.cpp
Done-with: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: Ibed987f6d77a0294f78f67d78625237616082416
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 07c1e8ca3a..3143abf182 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -542,6 +542,12 @@ void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags) void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) { + // Updating the window flags may affect the window's theme frame, which + // in the process retains and then autoreleases the NSWindow. To make + // sure this doesn't leave lingering releases when there is no pool in + // place (e.g. during main(), before exec), we add one locally here. + QMacAutoReleasePool pool; + if (!isContentView()) return; @@ -1373,11 +1379,14 @@ void QCocoaWindow::recreateWindowIfNeeded() if (m_windowModality != window()->modality()) recreateReason |= WindowModalityChanged; - const bool shouldBeContentView = !parentWindow && !isEmbeddedView; + Qt::WindowType type = window()->type(); + + const bool shouldBeContentView = !parentWindow + && !((type & Qt::SubWindow) == Qt::SubWindow) + && !isEmbeddedView; if (isContentView() != shouldBeContentView) recreateReason |= ContentViewChanged; - Qt::WindowType type = window()->type(); const bool isPanel = isContentView() && [m_view.window isKindOfClass:[QNSPanel class]]; const bool shouldBePanel = shouldBeContentView && ((type & Qt::Popup) == Qt::Popup || (type & Qt::Dialog) == Qt::Dialog); |