Uploaded image for project: ' AGL Development'
  1. AGL Development
  2. SPEC-3136

Qtwayland race when showing up panels

XMLWordPrintable

      Investigate why on qtwayland from AGL we don't display the bottom panel/additional panels when using agl-shell protocol. 

       

      Some context and explanation of the issue:

      • The compositor implements agl-shell, a protocol designed to allow the client shell to set-up roles to surfaces and arrange/orient them accordingly. 
      • The protocol works on top XDG shell. Latest version can be seen at https://gitlab.collabora.com/mvlad/native-app-qt/blob/master/native-app-qt/protocol/agl-shell.xml
      • Client shell (on client side in Qt) is done by using qApp (qplatformnativeinterface) and QQmlComponent(s) to bind to that
        agl-shell and create a QQmlComponent from QML files. Specifically a QML file is used to return a wl_surface for it,  which later on is passed to the agl-shell to set-up the role. Now, in the client shell application we use single-shot timer set-up, which should fire a ready request to signal back the compositor that all the surfaces are done loading and it is ready to display the content. On the server side it is the same mechanism used in XDG shell to delay presentation.
      • On qtwayland version from AGL, that single shot timer is never fired or it fires in some rather weird combination. This has the side effect that some of the panels are never displayed or the compositor will never show up the content (as the ready request from agl-shell protocol is never sent)

      What I've already tried:

      • On the same version from AGL, using a C application I can display all the panels and the background
      • Locally, testing both the compositor and the client shell, but a newer qtbase/qtwayland 5.12 (or 5.13) I'm not seeing the issue.
      • Forcing a roundtrip or flushing events before and after agl-shell request seem to stop the timer from firing at all. I don't
        really have an explanation for it. Protocol debugging doesn't really help: on AGL 5.11 version it seems the event loop is stuck on processing
        events.

      Code examples for this can be found at (simple client shell, which uses only a background, panels but with simple QMLs to avoid any other dependencies – this can also be built with yocto or local):

       * https://gitlab.collabora.com/mvlad/native-app-qt

      For this example the single-shot is never fired (see the attached debug protocol log, in attachments) 

      Or at (which is an adaptation of homescreen):

      https://gerrit.automotivelinux.org/gerrit/gitweb?p=apps%2Fhomescreen.git;a=shortlog;h=refs%2Fheads%2Fsandbox%2Fmvlad%2Fagl-compositor

      For this example the ready request is sent but the bottom panel is never displayed (see the protocol dump)

       

        1. homescreen_qt_debug.txt
          113 kB
        2. homescreen_wayland_proto.txt
          18 kB
        3. native_app_qt_wayland_proto.txt
          19 kB
        4. native_app_qt.txt
          27 kB
        5. native-app-qt-local.txt
          3 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            mvlad Marius Vlad
            mvlad Marius Vlad
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: