I think that following fix made a regression on platforms using QtWayland
The regression is that in some cases re-parenting the widget doesn't work as expected. I think the reason for that is that on Wayland every hide will call reset and that will result in SurfaceAboutToBeDestroyed send from it. This will clear WA_WState_Created. This is where the problem begins.
I am attaching the stack trace, please refer to it: QWidegtSurfaceAboutToBeDestroyed.bt
Note that in our case we use QSPlitter, and we are adding a widget to it. This results with setParent being called
void QWidget::setParent(QWidget *parent, Qt::WindowFlags f)
and hide will be called from it.
This, on Wayland, will call reset and SurfaceAboutToBeDestroyed and clearing the WA_WState_Created. The problem is that we are not done using it!
Note that after we return from hide the d->setParent_sys(parent, f) is called unconditionally. The setParent_sys will check WA_WState_Created again. However it is now cleared by the new patch. The wasCreated flag is false now and the
// Reparenting toplevel to child
block is not executed. When it is executed, everything is working fine on our platform, but when it is not, then we have strange results regarding focus and areas with which the widget can handle touches (hard to explain but touches are offset, that mean the touch point is far away from where Qt recognize it was).