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 <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
34fadcfeb1
commit
4bcec703c4
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user