[Development] QtWayland compositor can't to render a wl_surface to multi outputs, Is this a restrict of QtQuick graphics scene?

JiDe Zhang zccrs at live.com
Tue Jul 4 09:06:19 CEST 2023


The following is a part of an QtWayland example:

WaylandOutput {
        sizeFollowsWindow: true
        window: Window {
            width: 1024
            height: 768
            visible: true

            Repeater {
                model: shellSurfaces

                ShellSurfaceItem {
                    shellSurface: modelData
                    onSurfaceDestroyed: shellSurfaces.remove(index)
                }
            }
        }
}


If I have two displays, and a part of a ShellSurfaceItem is in the first display, and the other part of the ShellSurfaceItem in the second display. In this case, I need to ensure the user can see this ShellSurfaceItem
on both first and second displays, on QtWayland, I can using two WaylandOutput with two Window for this case, and create ShellSurfaceItem for which WaylandOutput.

But, If I using two ShellSurfaceItem for one wl_surface, I can't sync the window animation in different WaylandOutput, this is a hard job, because the QQuickItem must bind to single Window, it's can't render to multi Windows.

The better way is redesign QtQuick scene graphics, like as:


  1.  Add QQuickScene class to instead of a part of functions of QQuickWindow. a QQuickItem must be added to a QQuickScene, a QQuickScene is a coordinate system.
  2.  Add QQuickViewport class, and allow attach multi QQuickViewport to one QQuickScene. the QQuickViewport be responsible for render QQuickItem to target output. And allow the QQuickViewport can render in a new thread(be different than the other QQuickViewport in same QQuickScene).
  3.  Add QQuickRenderTarget::fromSurface(EGLSurface/VkSurface) functions, and using QQuickRenderTarget to QQuickViewport::render(QQuickRenderTarget target).
  4.  The QQuickWindow don't depends on QSG* class, it can wapper QQuickViewport and QQuickRenderTarget to render QQuickItem.
  5.  Add QQuickSceneHelper abstract class, The QQuickWindow event dispense to QQuickSceneHelper, and QQuickSceneHelper dispense event to QuickItem. Provide like as "virtual QQuickSceneHelper::setCursor" functions to instead of QQuickWindow::setCursor in QQuickItem::setCursor.
  6.  The QQuickItem without QQuickWindow, using QQuickItem::pixelRatio to instead of QQuickWindow::effectiveDevicePixelRatio(), the QQuickItem::pixelRatio is only using for load resources(like as QQuickImage::load), for the render matrix, using the QQuickViewport::devicePixelRatio when rendeing.

The above changes may not change the abi.

If I misunderstand QtWayalnd and QtQuick Scene Graphics, please tell me, thanks.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20230704/748e697f/attachment-0001.htm>


More information about the Development mailing list