Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
6.9, 6.10
-
None
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