Update framestrut initially after window creation

Creating native widgets such as QGLWidget and then calling move()
on top level widget before doing show() on it caused framestrut to
be incorrect, as native widgets force the creation of the
native windows also on their ancestors when they are constructed,
rather than waiting for window to be shown.

Change-Id: I3e8d60547b3b683178ba059c5d92526a1d447442
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Miikka Heikkinen 2012-07-05 17:09:44 +03:00 committed by Qt by Nokia
parent 2df94c5182
commit 1c1bde0312

View File

@ -1350,6 +1350,13 @@ void QWidget::create(WId window, bool initializeWindow, bool destroyOldWindow)
if (isWindow() && !testAttribute(Qt::WA_SetWindowIcon))
d->setWindowIcon_sys();
}
// Frame strut update needed in cases where there are native widgets such as QGLWidget,
// as those force native window creation on their ancestors before they are shown.
// If the strut is not updated, any subsequent move of the top level window before show
// will cause window frame to be ignored when positioning the window.
// Note that this only helps on platforms that handle window creation synchronously.
d->updateFrameStrut();
}
/*!