summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-06-28 10:20:35 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-07-07 02:01:22 +0000
commita4c8129d099840b366a27e4342a65d7cae5890e9 (patch)
tree8e88e295f9356f37c2e3c4dc396b13141cc8cfb5 /src/plugins/platforms/cocoa
parent06904a7a772357479a1b78b8345716f8d0711b4c (diff)
Relieve platform plugins of having to persist geometry on WM callbacks
We can offload this to QGuiApplication, just like the geometry of the QWindow is set. This ensures that all platforms behave the same, and that the documentation of QPlatformWindow::setGeometry is adhered. Change-Id: I19dbc32cb4fb146d716ec289c28030a547d3afaa Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm7
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm8
2 files changed, 2 insertions, 13 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 4bf65d9f5b..6431480116 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -281,11 +281,11 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::setCocoaGeometry" << window() << rect;
QMacAutoReleasePool pool;
+ QPlatformWindow::setGeometry(rect);
+
if (m_viewIsEmbedded) {
if (!isForeignWindow()) {
[m_view setFrame:NSMakeRect(0, 0, rect.width(), rect.height())];
- } else {
- QPlatformWindow::setGeometry(rect);
}
return;
}
@@ -297,9 +297,6 @@ void QCocoaWindow::setCocoaGeometry(const QRect &rect)
[m_view setFrame:NSMakeRect(rect.x(), rect.y(), rect.width(), rect.height())];
}
- if (isForeignWindow())
- QPlatformWindow::setGeometry(rect);
-
// will call QPlatformWindow::setGeometry(rect) during resize confirmation (see qnsview.mm)
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 6e5b749747..20d90f501e 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -294,9 +294,6 @@ static QTouchDevice *touchDevice = 0;
geometry = QRectF::fromCGRect(NSRectToCGRect([self frame])).toRect();
}
- if (m_platformWindow->isContentView() && geometry == m_platformWindow->geometry())
- return;
-
const bool isResize = geometry.size() != m_platformWindow->geometry().size();
// It can happen that self.window is nil (if we are changing
@@ -308,11 +305,6 @@ static QTouchDevice *touchDevice = 0;
qCDebug(lcQpaCocoaWindow) << "[QNSView udpateGeometry:]" << m_platformWindow->window()
<< "current" << m_platformWindow->geometry() << "new" << geometry;
- // Call setGeometry on QPlatformWindow. (not on QCocoaWindow,
- // doing that will initiate a geometry change it and possibly create
- // an infinite loop when this notification is triggered again.)
- m_platformWindow->QPlatformWindow::setGeometry(geometry);
-
// Don't send the geometry change if the QWindow is designated to be
// embedded in a foreign view hiearchy but has not actually been
// embedded yet - it's too early.