91e75e620b
CI: cua-driver distro-compat matrix / debian:12 (glibc 2.36) (push) Has been cancelled
CI: SPDX Headers / Check SPDX headers (warn-only) (push) Has been cancelled
CD: Docs MCP Server / build (linux/amd64) (push) Has been cancelled
CD: Docs MCP Server / build (linux/arm64) (push) Has been cancelled
CD: Docs MCP Server / merge (push) Has been cancelled
CI: cua-driver distro-compat matrix / Resolve release version (push) Has been cancelled
CI: cua-driver distro-compat matrix / fedora:41 (glibc 2.40) (push) Has been cancelled
CI: cua-driver distro-compat matrix / rockylinux:9 (glibc 2.34) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:22.04 (glibc 2.35) (push) Has been cancelled
CI: cua-driver distro-compat matrix / ubuntu:24.04 (glibc 2.39) (push) Has been cancelled
CI: cua-driver distro-compat matrix / Distro compat summary (push) Has been cancelled
CI: Rust Linux unit / Rust Linux unit and compile (push) Has been cancelled
CI: Rust Windows unit / Rust Windows unit and compile (push) Has been cancelled
CI: Nix Linux Rust source / Nix / compositor build (push) Has been cancelled
CI: Nix Linux Rust source / Nix / driver package (push) Has been cancelled
CI: Nix Linux Rust source / Nix / Rust unit tests (push) Has been cancelled
57 lines
2.1 KiB
Rust
57 lines
2.1 KiB
Rust
//! Standalone smoke for the libei input path on platform-linux.
|
|
//!
|
|
//! Drives `wayland::libei::move_absolute` + `click` and prints what happens.
|
|
//! Stress-tests the portal RemoteDesktop handshake plus the reis-based EIS
|
|
//! handshake on a real GNOME / KDE-Wayland host.
|
|
//!
|
|
//! Usage:
|
|
//! CUA_DRIVER_RS_ENABLE_WAYLAND=1 \
|
|
//! WAYLAND_DISPLAY=wayland-0 \
|
|
//! cargo run --example libei_input --release
|
|
|
|
fn main() {
|
|
let _ = tracing_subscriber::FmtSubscriber::builder()
|
|
.with_max_level(tracing::Level::DEBUG)
|
|
.with_writer(std::io::stderr)
|
|
.try_init();
|
|
|
|
eprintln!("== platform-linux libei input smoke ==");
|
|
eprintln!(
|
|
" WAYLAND_DISPLAY={:?} XDG_RUNTIME_DIR={:?} DBUS_SESSION_BUS_ADDRESS={:?}",
|
|
std::env::var("WAYLAND_DISPLAY").ok(),
|
|
std::env::var("XDG_RUNTIME_DIR").ok(),
|
|
std::env::var("DBUS_SESSION_BUS_ADDRESS").ok(),
|
|
);
|
|
|
|
// Try a no-op move first — opens the portal handshake + EIS context.
|
|
eprintln!("\n-- move_absolute(500, 400) --");
|
|
let t = std::time::Instant::now();
|
|
match platform_linux::wayland::libei::move_absolute(500.0, 400.0) {
|
|
Ok(()) => eprintln!(" OK in {:?}", t.elapsed()),
|
|
Err(e) => eprintln!(" ERR after {:?}: {}", t.elapsed(), e),
|
|
}
|
|
|
|
eprintln!("\n-- click(500, 400, Left) --");
|
|
let t = std::time::Instant::now();
|
|
match platform_linux::wayland::libei::click(
|
|
500.0, 400.0,
|
|
platform_linux::wayland::libei::Button::Left,
|
|
) {
|
|
Ok(()) => eprintln!(" OK in {:?}", t.elapsed()),
|
|
Err(e) => eprintln!(" ERR after {:?}: {}", t.elapsed(), e),
|
|
}
|
|
|
|
eprintln!("\n-- type_text('hello world') --");
|
|
let t = std::time::Instant::now();
|
|
match platform_linux::wayland::libei::type_text("hello world") {
|
|
Ok(()) => eprintln!(" OK in {:?}", t.elapsed()),
|
|
Err(e) => eprintln!(" ERR after {:?}: {}", t.elapsed(), e),
|
|
}
|
|
|
|
eprintln!("\n-- shutdown --");
|
|
platform_linux::wayland::libei::shutdown();
|
|
// Give the worker a moment to drain.
|
|
std::thread::sleep(std::time::Duration::from_millis(500));
|
|
eprintln!("done");
|
|
}
|