summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-10-22 21:22:05 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-10-29 05:10:30 +0000
commite02d758c9509de31aafc82d53296f1acdab55151 (patch)
tree788688473d3f30a84e979995ab082d36a163c312 /src
parentacf5c37046944d6483cfc68b3d877b015292d415 (diff)
macOS: Treat explicitly set Qt::SubWindows as not needing a NSWindow
We used to have logic that explicitly marked a QWindow as "embedded", but we now resolve this dynamically based on whether or not we have a parent window owned by Qt or not. As part of this refactoring the fix for QTBUG-63443 in ac35f9c44c got lost. We restore the behavior by treating Qt::SubWindow as a reason not to create a NSWindow for a view. This flag is set by QMenuPrivate::moveWidgetToPlatformItem already. Fixes: QTBUG-63443 Change-Id: I12bff546eefcb8f6c9ca43b1b879773d129a28f9 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index a28bdd628b..1ce671941d 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -1378,11 +1378,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);