summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoawindow.mm
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2016-10-20 14:50:19 +0200
committerTimur Pocheptsov <timur.pocheptsov@theqtcompany.com>2016-10-21 14:53:50 +0000
commit1b8bc2c97f60c172021a36fed15184bb65eb1ff9 (patch)
tree760ff47229376d2b6bd2705e2510f3e9145b2875 /src/plugins/platforms/cocoa/qcocoawindow.mm
parentbe911de2592845160fa2b76dd14d9d71ef386f09 (diff)
macOS: Remove unneeded argument to QCocoaWindow::recreateWindow()
The parent window is available through QPlatformWindow::parent(). Change-Id: I2436c001ec18f5abba99db3061acb0edcd8035a2 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 2d4e53a420..d10d50aca9 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -404,7 +404,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
[m_view setWantsLayer:enable];
}
setGeometry(tlw->geometry());
- recreateWindow(QPlatformWindow::parent());
+ recreateWindow();
tlw->setGeometry(geometry());
if (tlw->isTopLevel())
setWindowIcon(tlw->icon());
@@ -638,7 +638,7 @@ void QCocoaWindow::setVisible(bool visible)
if (visible) {
// We need to recreate if the modality has changed as the style mask will need updating
if (m_windowModality != window()->modality() || isNativeWindowTypeInconsistent())
- recreateWindow(QPlatformWindow::parent());
+ recreateWindow();
// Register popup windows. The Cocoa platform plugin will forward mouse events
// to them and close them when needed.
@@ -1156,7 +1156,7 @@ void QCocoaWindow::setParent(const QPlatformWindow *parentWindow)
// recreate the window for compatibility
bool unhideAfterRecreate = parentWindow && !m_viewIsToBeEmbedded && ![m_view isHidden];
- recreateWindow(parentWindow);
+ recreateWindow();
if (unhideAfterRecreate)
[m_view setHidden:NO];
setCocoaGeometry(geometry());
@@ -1262,8 +1262,10 @@ QCocoaGLContext *QCocoaWindow::currentContext() const
}
#endif
-void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
+void QCocoaWindow::recreateWindow()
{
+ const QPlatformWindow *parentWindow = QPlatformWindow::parent();
+
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindow" << window()
<< "parent" << (parentWindow ? parentWindow->window() : 0);
@@ -1279,7 +1281,7 @@ void QCocoaWindow::recreateWindow(const QPlatformWindow *parentWindow)
QWindow *parentQWindow = m_parentCocoaWindow->window();
if (!parentQWindow->property("_q_platform_MacUseNSWindow").toBool()) {
parentQWindow->setProperty("_q_platform_MacUseNSWindow", QVariant(true));
- m_parentCocoaWindow->recreateWindow(m_parentCocoaWindow->m_parentCocoaWindow);
+ m_parentCocoaWindow->recreateWindow();
}
}