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

Wayland: Freeze when rendering subsurface which covers entire main surface

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.9, 6.10
    • QPA: Wayland
    • None
    • Linux/Wayland

    Description

      Qt application freezes on many Wayland compositors when it's rendering a subsurface (a child QWindow) which covers entire main surface (top-level QWindow). It works in kwin and hyprland, but doesn't work elsewhere (weston, mutter, wlroots-based compositors). Many compositors don't allow to render main surface when it's invisible (even if it's covered only by a child subsurface) - in this case the client application freezes - it's intentional behavior (see https://github.com/labwc/labwc/issues/2850#issuecomment-2993760849). It means that main surface must not call any swapbuffers functions when it's entirely covered by a subsurface.

      Use case: QtWidgets application which uses "QWidget::createWindowContainer()" for QOpenGLWindow or QVulkanWindow to display a video content. When QtWidgets UI is hidden (e.g. fullscreen), we'll have a main surface (QWindow of main QWidget) entirely covered by a subsurface (e.g. QVulkanWindow).

      Attached example software to reproduce the issue qt-wl-subsurface.zip uses QRasterWindow as a subsurface, but it could also be QVulkanWindow or QOpenGLWindow. This application should not be tested on kwin and hyprland. It should be tested in labwc, sway, mutter, weston. Looks like freeze happens when main window receives an expose event with NULL region. If you modify "margin" to value greater than 0, the app will not freeze.

       

      EDIT: On compositors which stops rendering main surface when it's entirely covered by a subsurface the "mFrameCallbackTimedOut" is set after 100ms timeout which means all subsurfaces are unexposed, too, so it Qt stops rendering anything. Attached proof of concept patch: QTBUG-137940-v1.diff

      Attachments

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

        Activity

          People

            davidedmundson David Edmundson
            zaps166 Błażej Szczygieł
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes