From 4bcec703c4869b1e093aa8a54180b7a6145bbca2 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 9 Apr 2013 14:13:36 +0200 Subject: [PATCH] OSX window: set QWindow geometry after native window is created Initial window position is at 0,0 by default, then it's corrected in createNSWindow (by calling initialGeometry). After window creation, QNSWindowDelegate will receive the windowDidMove notification and call QCocoaWindow::windowDidMove() which then calls QNSView::updateGeometry(). It will not call QWindowSystemInterface::handleGeometryChange() because the window is still being constructed. So we can fix this by directly setting QWindow::geometry in the QCocoaWindow constructor. Task-number: QTBUG-30382 Change-Id: I3db7a6e83693e5787ae82dcab1767de938d2e5d1 Reviewed-by: Gabriel de Dietrich --- src/plugins/platforms/cocoa/qcocoawindow.mm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index b75f822e2d..4e567c6c63 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -211,9 +211,8 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) m_qtView = [[QNSView alloc] initWithQWindow:tlw platformWindow:this]; m_contentView = m_qtView; setGeometry(tlw->geometry()); - recreateWindow(parent()); - + tlw->setGeometry(geometry()); m_inConstructor = false; }