diff options
author | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-03-26 15:48:24 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2018-03-26 15:16:00 +0000 |
commit | 91cf255c5ad4eea8ad2022d8d9904f8b6419024a (patch) | |
tree | b8eef1c06d0eb938ed7b90fdc915e33b1815dc73 | |
parent | 602fd9eb7e58552fd5b10a96c457fba33c4eff8e (diff) |
Cocoa: Fix isChildNSWindow() for embedded QWindows
Commit e3d21ef0 removed the manual m_isNSWindowChild
mode in favor of using m_view.window.parentWindow
as a declarative test.
However, this test has a false positive if the QWindow
in question is a non-child QWindow which is embedded
in a foreign NSView/NSWindow hierarchy. In the QTBUG-56589
case m_view.window.parentWindow is some internal window
in the Photos app, which is not relevant to the Qt
QWindow configuration.
Improve the isChildWindow() test: the QWindow must
actually be a child QWindow.
Task-number: QTBUG-56589
Change-Id: I0e6e262c85f47267a6165e7f98e48264b1e00069
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index aeeef55598..86fd7b8a9f 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1608,7 +1608,7 @@ QCocoaGLContext *QCocoaWindow::currentContext() const */ bool QCocoaWindow::isChildNSWindow() const { - return m_view.window.parentWindow != nil; + return window()->parent() != nullptr && m_view.window.parentWindow != nil; } /*! |