Prune commentary and stale Rust port notes
This commit is contained in:
1 parent
3ae034a47b
commit
1e6d3b1edd
84 files changed
+334
-5648
No files matched your search
@@ -1,19 +1,3 @@
|
||||
//! Replays a `.touch` file into the compositor as a left-button drag --
|
||||
//! see this crate's `Cargo.toml` for why it exists rather than
|
||||
//! `swaymsg seat - cursor`.
|
||||
//!
|
||||
//! WAYLAND_DISPLAY=… replay-touch WIDTH HEIGHT FILE
|
||||
//!
|
||||
//! `WIDTH`/`HEIGHT` are the output's own size, because the virtual
|
||||
//! pointer protocol positions absolutely against an extent rather than
|
||||
//! in pixels; passing the output size makes a script's coordinates mean
|
||||
//! the same pixels they mean in the headless tests.
|
||||
//!
|
||||
//! Replayed in real time (the sleeps between samples are the gaps in the
|
||||
//! file), because winit has no timestamp on a pointer event and dates
|
||||
//! each one when it arrives -- so a 20ms flick has to actually take
|
||||
//! 20ms here, unlike layer 1 where the sample carries its own time.
|
||||
|
||||
use iris::harness::{TouchAction, TouchScript};
|
||||
use std::time::Duration;
|
||||
use wayland_client::protocol::wl_pointer::ButtonState;
|
||||
@@ -24,12 +8,8 @@ use wayland_protocols_wlr::virtual_pointer::v1::client::{
|
||||
zwlr_virtual_pointer_v1::ZwlrVirtualPointerV1,
|
||||
};
|
||||
|
||||
/// `linux/input-event-codes.h`. The protocol takes the kernel's own
|
||||
/// button code, not a wayland enum.
|
||||
const BTN_LEFT: u32 = 0x110;
|
||||
|
||||
/// How long the pointer sits at the gesture's first position before the
|
||||
/// script starts -- see the comment at the pre-step in `main`.
|
||||
const SETTLE: Duration = Duration::from_millis(200);
|
||||
|
||||
#[derive(Default)]
|
||||
@@ -126,9 +106,6 @@ fn main() {
|
||||
previous = sample.t_ms;
|
||||
let t = sample.t_ms as u32;
|
||||
pointer.motion_absolute(t, sample.pos.x as u32, sample.pos.y as u32, width, height);
|
||||
// One frame per sample, so the compositor delivers them as
|
||||
// separate pointer frames rather than coalescing the whole
|
||||
// gesture -- the shape the file recorded is the point.
|
||||
pointer.frame();
|
||||
// The button goes in a frame of its own, *after* the motion has
|
||||
// been committed. Sent in the same frame as the motion that
|
||||
|
||||
Reference in new issue
Block a user