Set geometry set by QPlatformWindow::initialGeometry() on widget.

Task-number: QTBUG-30855

Change-Id: I15f3dfa0b493874671711cce2190d0710b368796
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Friedemann Kleint 2013-04-30 12:44:59 +02:00 committed by The Qt Project
parent 37aa3e0155
commit eb11f67dd9

View File

@ -543,6 +543,13 @@ void QWidgetPrivate::show_sys()
#endif
invalidateBuffer(q->rect());
window->setVisible(true);
// Was the window moved by the Window system or QPlatformWindow::initialGeometry() ?
if (window->isTopLevel()) {
const QPoint crectTopLeft = q->data->crect.topLeft();
const QPoint windowTopLeft = window->geometry().topLeft();
if (crectTopLeft == QPoint(0, 0) && windowTopLeft != crectTopLeft)
q->data->crect.moveTopLeft(windowTopLeft);
}
}
}