Qt Wayland Compositor Examples - Multi Screen▲
Multi-screen is a desktop-style Wayland compositor example for multiple screens.
When a client creates a shell surface, one ShellSurfaceItem is created on each screen. The ShellSurfaceItem will be visible only on one (or two) screens at a time. ShellSurfaceItem positions are synchronized so that when windows enter one screen they are moved off another at the same time.
WaylandQuickItem::setPrimary() is called at appropriate times to set the primary view for the ShellSurface, which is used when the client asks to be maximized or fullscreen.
In order to support multiple Wayland outputs in the same compositor, the Qt::AA_ShareOpenGLContexts attribute must be set before the QGuiApplication object is constructed.