Abstracts the layer-shell protocol binding. More...
#include <phosphor-layer/include/PhosphorLayer/ILayerShellTransport.h>
Public Types | |
| using | CompositorLostCallback = std::function< void()> |
| Register a callback fired when the compositor's layer-shell global is removed (compositor crash / restart). | |
| using | CompositorLostCookie = quint64 |
Public Member Functions | |
| ILayerShellTransport ()=default | |
| virtual | ~ILayerShellTransport ()=default |
| virtual bool | isSupported () const =0 |
| True if the compositor advertises wlr-layer-shell. | |
| virtual std::unique_ptr< ITransportHandle > | attach (QQuickWindow *win, const TransportAttachArgs &args)=0 |
Mark win as a layer-shell surface with the given initial configuration. | |
| virtual CompositorLostCookie | addCompositorLostCallback (CompositorLostCallback cb)=0 |
| virtual void | removeCompositorLostCallback (CompositorLostCookie cookie)=0 |
Abstracts the layer-shell protocol binding.
Default implementation: PhosphorWaylandTransport (provided in a later phase, wraps PhosphorWayland::LayerSurface). Tests inject a MockTransport and exercise the full lifecycle without Wayland.
| using PhosphorLayer::ILayerShellTransport::CompositorLostCallback = std::function<void()> |
Register a callback fired when the compositor's layer-shell global is removed (compositor crash / restart).
The library's TopologyCoordinator uses this to tear down all attached handles; consumer code generally does not need to subscribe. Callbacks run on the Wayland event-dispatch context — consumers must marshal to the GUI thread themselves if needed.
Returns an opaque cookie; pass it to removeCompositorLostCallback to unsubscribe. 0 is reserved for "registration refused" (e.g. null callback) and is safe to pass to remove. Long-lived transports without unsubscribe accumulate dead callbacks indefinitely — always remove on consumer destruction.
| using PhosphorLayer::ILayerShellTransport::CompositorLostCookie = quint64 |
|
default |
|
virtualdefault |
|
pure virtual |
Implemented in PhosphorLayer::PhosphorWaylandTransport, and PhosphorLayer::XdgToplevelTransport.
|
pure virtual |
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.
Implemented in PhosphorLayer::PhosphorWaylandTransport, and PhosphorLayer::XdgToplevelTransport.
|
pure virtual |
True if the compositor advertises wlr-layer-shell.
Surfaces fail construction with a logged reason when this returns false.
Implemented in PhosphorLayer::PhosphorWaylandTransport, and PhosphorLayer::XdgToplevelTransport.
|
pure virtual |
Implemented in PhosphorLayer::PhosphorWaylandTransport, and PhosphorLayer::XdgToplevelTransport.