Products › lamco-dsi-tools › Docs › How to check which screen capture and input methods a Wayland desktop supports

How to check which screen capture and input methods a Wayland desktop supports

Which screen capture and input routes a desktop offers, and which of them actually deliver.

You want to know how a program can capture the screen and send input on a particular desktop: Which routes it offers, and which of them actually deliver. With lamco-dsi-tools (DSI: Desktop session interfaces) you'll first ask what's advertised, which changes nothing, then exercise each route and read the result. Which routes a desktop has is its design: GNOME and KDE capture through the ScreenCast portal and PipeWire and take input through libei, and a wlroots compositor offers its own capture and virtual input protocols.

1. What is advertised

dsisee input routes
dsisee observe --out routes.json
dsitell health routes.json

dsisee input routes says which input routes the desktop advertises, in both directions, from the uinput node, the Wayland registry, the portal and what of libei is installed, and what each has for touch. It sends nothing. dsisee observe records the rest, and dsitell health gives the capture and input functions with their routes. At this stage a route is at most present: The pieces are there, and nothing has exercised them.

If the portal hadn't been started (PORTAL-008), its routes are not examined. Add --wake-portal to observe.

2. Does screen capture deliver?

On a compositor that advertises ext-image-copy-capture-v1 or wlr-screencopy:

dsisee capture probe --duration 10 --out capture.json

On GNOME and KDE, which capture through the portal, the command shows a permission dialog and needs a build with the pipewire feature (the gnu tarball):

dsisee capture probe --route portal --duration 10 --out capture.json

The command says which route it took and why, then summarizes the frames or buffers. A screen that doesn't change may give one buffer and no more, since compositors send a buffer when the screen changes. To give it something to time, run an animation beside it:

dsido screen animate --rate 60 --duration 10 --out animate.json &
dsisee capture probe --read-markers --duration 8 --out capture.json
dsitell glass animate.json capture.json

dsitell glass says which frames the compositor presented and the capture route didn't deliver.

3. Does input deliver?

Open a witness window, send input through a route, and pair the two:

dsisee input witness --duration 60 --out witness.json &
dsido wlr inject text "hello" --out inject.json      # wlroots compositors
dsitell loop inject.json witness.json

On GNOME and KDE, send through libei with dsido eis inject text "hello" --out inject.json, which shows a permission dialog. Through the kernel, dsido kernel inject text "hello" --out inject.json needs the right to open /dev/uinput; --elevate-with sudo starts the helper with it. Give the witness window the keyboard focus before the keys are sent: A compositor delivers a key only to the focused window, and dsitell loop says when a step wasn't seen because the witness lacked the focus.

4. What to look at

  • dsitell loop exits 0 when every step a window can see was seen, and 1 when one wasn't. Its report pairs each step with its event.
  • Run dsitell health on the injection capture or the capture-probe capture. A route becomes working only in a capture that exercised it: Frames or buffers delivered, or steps a dsido injector sent.
  • A route that's broken was exercised and failed. The findings say how, for example CAP-004 (a screen cast delivered no buffer), CAP-006 (the stream wasn't read, as in a build without pipewire), INPUT-005 or INPUT-006.
  • To set several desktops side by side, take the same captures on each and run dsitell matrix sway.json gnome.json kde.json.

Related