Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-96216

Reparenting doesnt work as expected with Wayland QPA

    XMLWordPrintable

Details

    • Linux/Wayland

    Description

      I think that following fix made a regression on platforms using QtWayland

      https://code.qt.io/cgit/qt/qtbase.git/commit/?h=5.12.9&id=e2f35fa6842508f6bd9d2343f08a17a2a292fd71

      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).

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            elfoniok Lukasz Foniok
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes