Layer 2 of docs/RUST.md's "Three test layers":
./run-headless.sh phone --phone --shot /tmp/p.png -- -p transcript-fixture
opens `transcript-fixture`'s screen -- the same fixture and the same
fold the headless tests and the Android bench use -- in a window at the
phone's own 1080x2424 and `content_scale` 2.55, and screenshots it. 15
seconds, warm. `--replay FILE` drives one of the `.touch` recordings
into it and writes `<shot>-before.png` too, so "the list moved" is two
pictures: the flick carries it back about seven turns of the fixture.
Two things this needed.
**The desktop backend now lays out in physical pixels with a density,
exactly as Android does** (`default::content_scale`, overridable with
`IRIS_SCALE`, which is how `--phone` hands it the phone's). It used to
divide winit's coordinates into a separate "logical" space, which left
`UiRenderState::resize` (physical, from `WindowEvent::Resized`) and the
window uniform (logical) disagreeing on any display whose scale factor
is not 1.0, and rasterised glyphs at one resolution to show them at
another. At 1.0 -- every display here -- the numbers are unchanged, and
the `tabs` screenshot is identical.
**`rig-input`'s `replay-touch`** puts a gesture on screen. This
machine's compositor has no pointer to move: sway runs on the headless
backend with no input devices, so `swaymsg seat - cursor press` reports
success and `swaymsg -t get_seats` shows `capabilities: 0`. wlroots 0.19
dropped `WLR_HEADLESS_INPUTS` and ydotool's uinput device would be
ignored by a compositor not reading libinput, so the virtual-pointer
protocol is what is left. It parses the *same* `TouchScript` the
harness does, so one recording drives both layers.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
33 lines
1.3 KiB
TOML
33 lines
1.3 KiB
TOML
[package]
|
|
name = "rig-input"
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
|
|
# Layer 2's input half (docs/RUST.md's "Three test layers"): replays one
|
|
# of the `.touch` files the headless tests use into whatever window is
|
|
# under a Wayland compositor, so the *same recording* drives the
|
|
# assertion layer and the layer a person looks at.
|
|
#
|
|
# It exists because this machine's compositor has no pointer to move.
|
|
# `run-headless.sh` starts sway on the headless backend with no input
|
|
# devices at all (`WLR_LIBINPUT_NO_DEVICES=1`, `LIBSEAT_BACKEND=noop`),
|
|
# so `swaymsg seat - cursor press` reports success and nothing reaches
|
|
# the client -- `swaymsg -t get_seats` shows `capabilities: 0`. wlroots
|
|
# 0.19 dropped `WLR_HEADLESS_INPUTS`, and ydotool's uinput device would
|
|
# be ignored by a compositor that is not reading libinput. The
|
|
# virtual-pointer protocol is what is left, and it is a client protocol,
|
|
# so it needs no devices and no root.
|
|
|
|
# Named for what it does rather than for the crate, since the crate may
|
|
# grow a keyboard replay beside it.
|
|
[[bin]]
|
|
name = "replay-touch"
|
|
path = "src/main.rs"
|
|
|
|
[dependencies]
|
|
# `TouchScript` -- the same parser the harness uses, so a file that
|
|
# replays here and one that replays headless can never disagree.
|
|
iris = { path = ".." }
|
|
wayland-client = "0.31.15"
|
|
wayland-protocols-wlr = { version = "0.3.12", features = ["client"] }
|