summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-24 16:17:28 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-28 05:22:52 +0000
commite3d21ef0bf11ea6ddb154490eec6b76b36df3e73 (patch)
tree7dd199ba40888069110552a641520b414044708b /src/plugins/platforms/cocoa/qnsview.mm
parent8a49b314e3566615cbf000b7914efda6e268b6f8 (diff)
macOS: Remove m_isNSWindowChild in favor of m_view.window.parentWindow
Instead of manually maintaining the m_isNSWindowChild state, a new function has been introduced, isChildNSWindow(), which evaluates the condition based on whether or not m_view.window has a parent NSWindow. To achieve this, the recreateWindow() function was refactored to make it the sole point of deciding whether or not a reconfigure is needed, instead of having the logic partily at the call sites. That means the shouldUsePanel() and isNativeWindowTypeInconsistent() functions are no longer needed. QNSWindowHelper is only used for QNSWindow and QNSPanel, and m_isNSWindowChild is only set if the window has a parent (and child NSWindows was explicitly enabled), so we can use the normal QWindow topLevel logic. There's more potential for cleanup in recreateWindowIfNeeded(), but that's for later patches to keep this patch as small as possible. Verified NSWindowChild use-case with windowchildgeometry manual test. Change-Id: I34e8ca0cc2f8a1c399cc72691d66e09fab843f4d Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.mm')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 667a2381a0..6f469ec508 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -275,7 +275,7 @@ static bool _q_dontOverrideCtrlLMB = false;
{
QRect geometry;
- if (m_platformWindow->m_isNSWindowChild) {
+ if (self.window.parentWindow) {
return;
#if 0
//geometry = QRectF::fromCGRect([self frame]).toRect();