diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-10-22 21:22:05 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-10-29 05:10:30 +0000 |
commit | e02d758c9509de31aafc82d53296f1acdab55151 (patch) | |
tree | 788688473d3f30a84e979995ab082d36a163c312 /src/plugins/platforms | |
parent | acf5c37046944d6483cfc68b3d877b015292d415 (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/plugins/platforms')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 7 |
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); |