Fallback transport for compositors without wlr-layer-shell. More...
#include <phosphor-layer/include/PhosphorLayer/defaults/XdgToplevelTransport.h>
Public Member Functions | |
| XdgToplevelTransport () | |
| ~XdgToplevelTransport () 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 |
| void | simulateCompositorLost () |
| Fire every registered compositor-lost callback. | |
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 |
Fallback transport for compositors without wlr-layer-shell.
xdg_toplevel is the standard "application window" role — every Wayland compositor supports it. This transport lets PhosphorLayer run on non-Plasma compositors (GNOME/Mutter without layer-shell, nested Wayland sessions, etc.) with degraded behaviour:
Background/Bottom/Top/Overlay): ignored. The window stacks like any other.Exclusive and None cannot be expressed through xdg_toplevel alone.Use via SurfaceFactory::Deps when PhosphorWaylandTransport:: isSupported() returns false. Typically consumers probe at startup:
| PhosphorLayer::XdgToplevelTransport::XdgToplevelTransport | ( | ) |
|
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.
| void PhosphorLayer::XdgToplevelTransport::simulateCompositorLost | ( | ) |
Fire every registered compositor-lost callback.
Exposed primarily for tests that want to exercise consumer teardown paths without tearing down QGuiApplication. Consumers may also use this to inject a synthetic compositor-lost event (e.g. when a higher-level transport wrapper detects a logical disconnect that xdg_toplevel itself does not surface). Idempotent: once fired, the broadcaster stays fired and subsequent calls are no-ops.