Default transport: binds surfaces to wlr-layer-shell via PhosphorWayland's LayerSurface class. More...
#include <phosphor-layer/include/PhosphorLayer/defaults/PhosphorWaylandTransport.h>
Public Member Functions | |
| PhosphorWaylandTransport () | |
| ~PhosphorWaylandTransport () override | |
| bool | isSupported () const override |
| True if the compositor advertises wlr-layer-shell. | |
| std::unique_ptr< ITransportHandle > | attach (QQuickWindow *win, const TransportAttachArgs &args) override |
Mark win as a layer-shell surface with the given initial configuration. | |
| CompositorLostCookie | addCompositorLostCallback (CompositorLostCallback cb) override |
| void | removeCompositorLostCallback (CompositorLostCookie cookie) override |
Public Member Functions inherited from PhosphorLayer::ILayerShellTransport | |
| ILayerShellTransport ()=default | |
| virtual | ~ILayerShellTransport ()=default |
Additional Inherited Members | |
Public Types inherited from PhosphorLayer::ILayerShellTransport | |
| using | CompositorLostCallback = std::function< void()> |
| Register a callback fired when the compositor's layer-shell global is removed (compositor crash / restart). | |
| using | CompositorLostCookie = quint64 |
Default transport: binds surfaces to wlr-layer-shell via PhosphorWayland's LayerSurface class.
Stateless — isSupported() proxies to LayerSurface::isSupported(), and attach() creates exactly one LayerSurface per QWindow.
Compositor-lost detection covers two edges:
wl_registry::global_remove for zwlr_layer_shell_v1 and forwards the edge through PhosphorWayland::addCompositorLostCallback. This transport subscribes at construction so a compositor crash / restart fires registered callbacks before Qt tears the connection down.QGuiApplication::aboutToQuit covers the case where the application terminates before the compositor sent a removal.Both feed the same one-shot internal broadcaster, so consumer callbacks fire at most once.
Thread-safe: addCompositorLostCallback() may be called from any thread. Callbacks fire on the GUI thread (where aboutToQuit is emitted and where the QPA plugin dispatches Wayland events under the standard QGuiApplication setup) and are invoked outside the internal mutex, so callbacks may freely re-enter the transport without deadlocking.
| PhosphorLayer::PhosphorWaylandTransport::PhosphorWaylandTransport | ( | ) |
|
override |
|
overridevirtual |
Implements PhosphorLayer::ILayerShellTransport.
|
overridevirtual |
Mark win as a layer-shell surface with the given initial configuration.
MUST be called before win's first show(). Post-show properties that the protocol forbids mutating (layer output, scope, anchors in v1–3) are fixed at this point; later changes require destroy + re-attach.
Returns nullptr on failure; callers propagate as Surface::Failed.
Implements PhosphorLayer::ILayerShellTransport.
|
overridevirtual |
True if the compositor advertises wlr-layer-shell.
Surfaces fail construction with a logged reason when this returns false.
Implements PhosphorLayer::ILayerShellTransport.
|
overridevirtual |
Implements PhosphorLayer::ILayerShellTransport.