Expand description
Fake-input client delivering relative pointer motion into a nested KWin session.
org_kde_kwin_fake_input client: relative pointer motion for a nested KWin
session.
A nested compositor learns the pointer from pixelflux’s seat. wlroots sessions
bind the seat’s zwp_relative_pointer_v1 and forward each delta to their
own relative-pointer clients, so a game under labwc turns with the mouse.
KWin’s nested backend turns the host seat’s motion into absolute-only events
and hands its relative-pointer clients — Xwayland’s relative device included,
which SDL reads under a pointer grab — an empty delta; it binds the host’s
relative pointer only behind its Right-Ctrl debug lock, which also freezes
absolute positioning. KWin has no zwlr_virtual_pointer_v1 either. What it
offers is org_kde_kwin_fake_input, whose pointer_motion enters KWin’s
delta path, so a relative move is delivered here as a client of the app
compositor, followed by the seat’s own absolute move to the same position:
KWin sets its pointer from that rather than adding to it, which keeps the
two aligned — and realigns a KWin that moved its pointer by itself, as it
does when its screens change — while the composited cursor follows the seat
as always. Buttons and scrolling keep riding the seat. A compositor that
does not advertise the global keeps the seat path for deltas too.
KWin restricts the global to trusted clients unless
KWIN_WAYLAND_NO_PERMISSION_CHECKS is set in its environment; a session that
withholds it simply never shows the global here. Authentication is requested
once after binding, as the protocol requires before any event is honored.
The connection is made on its own thread when selkies names the app
compositor ([arm]), and re-made on demand, rate-limited, after a failure,
so the compositor thread only ever performs a non-blocking write per delta.
Functions§
- arm
- Point the client at the app compositor’s socket path (None clears it), dropping any device held on the previous one; the new connection is made off the caller’s thread.
- pointer_
motion_ rel - Deliver one delta through the app compositor’s fake-input device. False when no device serves it — nothing armed, a compositor without the global, or KWin not reachable right now — in which case the caller’s own seat carries the move.