Files
wehub-resource-sync 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
chore: import upstream snapshot with attribution
2026-07-13 13:03:19 +08:00

148 lines
6.9 KiB
TOML

[package]
name = "platform-linux"
version.workspace = true
edition.workspace = true
[dependencies]
tokio = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
anyhow = { workspace = true }
thiserror = { workspace = true }
tracing = { workspace = true }
async-trait = "0.1"
cua-driver-core = { path = "../cua-driver-core" }
cursor-overlay = { path = "../cursor-overlay" }
pip-preview = { path = "../pip-preview" }
# tiny-skia for cursor rendering (shared cross-platform)
tiny-skia = { version = "0.11", default-features = false, features = ["std"] }
[target.'cfg(target_os = "linux")'.dependencies]
# X11 background input + window enumeration
x11rb = { version = "0.13", features = ["xinput", "randr", "xfixes", "composite", "shape", "xtest"] }
x11 = { version = "2.21", features = ["xlib", "xinput", "xtest"] }
base64 = { workspace = true }
image = { workspace = true }
# kill(2) for the kill_app tool — SIGKILL via libc::kill.
libc = "0.2"
# Native AT-SPI over D-Bus (pure Rust, via zbus) — replaces the pyatspi
# subprocess bridge so accessibility input/readback needs no Python or GI
# typelibs at runtime. `tokio` matches the driver's async runtime; `zbus`
# re-exports the bus types we need (fdo::DBusProxy for pid resolution).
atspi = { version = "0.30", features = ["tokio", "zbus"] }
evdev = "0.12"
# Math-expression evaluator for parallel_mouse_drag `fn` paths (y = f(x)).
meval = "0.2"
# Native Wayland backend (window enumeration via wlr-foreign-toplevel-management;
# capture/input protocols added as those slices land). Pure-Rust client; used
# when running under a Wayland compositor with no X11 (no DISPLAY).
wayland-client = "0.31"
wayland-backend = "0.3"
wayland-scanner = "0.31"
wayland-protocols-wlr = { version = "0.3", features = ["client"] }
# Wayland staging protocols: ext-foreign-toplevel-list-v1,
# ext-image-capture-source-v1, ext-image-copy-capture-v1 (per-window
# screenshot on modern wlroots/GNOME/KDE) and wp-fractional-scale-v1 +
# wp-viewporter (HiDPI for the layer-shell overlay). The transitive pull
# from wayland-protocols-wlr does NOT enable `staging`; declaring it here
# unifies the feature globally.
wayland-protocols = { version = "0.32", features = ["client", "staging"] }
# xdg-desktop-portal client: display-screenshot tier
# (org.freedesktop.portal.Screenshot), per-window ScreenCast
# (org.freedesktop.portal.ScreenCast), and the libei input session
# (org.freedesktop.portal.RemoteDesktop.ConnectToEIS). `tokio` shares the
# driver's async runtime.
#
# ashpd's RemoteDesktop feature is pure Rust. Only our ScreenCast frame reader
# pulls pipewire-rs/libspa, whose headers are newer than Debian bullseye.
ashpd = { version = "0.13", default-features = false, features = ["tokio", "screenshot"] }
# zbus is pulled transitively via ashpd + atspi but declared directly so
# the portal-probe path in wayland::portal_screenshot can talk to the
# session bus without going through ashpd's higher-level builders.
zbus = { version = "5", default-features = false, features = ["tokio"] }
# Parse `file://` URIs returned by org.freedesktop.portal.Screenshot.
# ashpd re-exports `url` transitively; declared explicitly so ashpd
# version bumps cannot silently break the resolver.
url = "2"
# PipeWire client for the ScreenCast per-window capture path — dequeues
# frames from the node id returned by `open_pipe_wire_remote`. Pinned to
# 0.8 (last well-documented release; 0.10 had docs.rs build failures in
# mid-2026). Needs libpipewire-0.3 headers at build time — gated behind
# the `portal-capture` feature.
pipewire = { version = "0.8", optional = true }
# Companion to pipewire 0.8 — needed to construct the SPA_PARAM_EnumFormat
# pod (SPA_VIDEO_FORMAT_BGRx at announced width/height) we hand to
# `Stream::connect`. Same `portal-capture` gating as `pipewire`.
libspa = { version = "0.8", optional = true }
# Pure-Rust libei/libeis bindings for the GNOME/KDE input path (handshake
# → seat → device → pointer_absolute/button/scroll/keyboard/text). API is
# documented as "incomplete and subject to change" — budget for churn on
# the next bump. Re-exports `enumflags2` we use for `BitFlags<DeviceType>`.
reis = { version = "0.7", features = ["tokio"], optional = true }
# Calloop event loop drives the EIS worker thread — reis's example uses
# calloop::EventLoop + Generic source to multiplex EIS protocol reads
# with command-channel polling. reis 0.7 also ships a calloop adapter
# but we use the plain Generic source for clarity.
calloop = { version = "0.14", optional = true }
# Used directly in the ashpd RemoteDesktop call to compose
# `BitFlags::from(DeviceType::Keyboard) | DeviceType::Pointer`. reis also
# re-exports this same major version; pinning explicitly prevents
# duplicate-crate hazards.
enumflags2 = { version = "0.7", optional = true }
# Keymap fallback path for libei keyboard input when the EIS server does
# NOT advertise `ei_text` (libei < 1.6, i.e. older GNOME / KDE Plasma 6.0).
# Mirrors the reis `type-text.rs` example's keycode reverse-mapping.
xkbcommon = { version = "0.9", optional = true }
# Bounded MPSC command/reply channel for the persistent virtual-pointer
# owner thread. EventQueue<State> is !Send, so the persistent device must
# live on its own thread; crossbeam gives us a Send sender and synchronous
# reply channels that preserve the "tool call blocks until compositor
# roundtripped" contract the X11 path provides.
crossbeam-channel = "0.5"
# Resolve `$XDG_STATE_HOME` (with platform fallback) for persisting the
# ScreenCast and RemoteDesktop `restore_token`s so users see the consent
# dialog only once per install, not once per process.
dirs = "5"
[features]
default = []
linux-example = []
# GNOME/KDE input is pure Rust plus libxkbcommon, which is available in the
# Debian 11 release container. Ashpd's RemoteDesktop API exposes ScreenCast
# stream metadata, so its lightweight screencast module is required here too.
# The PipeWire frame reader remains isolated in portal-capture below.
portal-input = [
"ashpd/remote_desktop",
"ashpd/screencast",
"dep:reis",
"dep:calloop",
"dep:enumflags2",
"dep:xkbcommon",
]
# PipeWire-backed per-window ScreenCast capture keeps its newer system-header
# requirement and remains enabled by Nix/modern desktop builds.
portal-capture = [
"ashpd/screencast",
"dep:pipewire",
"dep:libspa",
]
# Backward-compatible full desktop feature used by the Nix package.
portal-libei = ["portal-input", "portal-capture"]
[dev-dependencies]
# Used by the `screenshot_cascade` example to surface the
# `tracing::debug!` lines emitted by each tier of the dispatch as it
# falls through.
tracing-subscriber = { workspace = true }
# Cargo example that exercises the libei input path directly. Lives under
# the `portal-input` feature gate so a stock `cargo build --examples`
# doesn't try to compile against the (now-optional) reis/xkbcommon deps.
[[example]]
name = "libei_input"
required-features = ["portal-input"]
[[example]]
name = "screenshot_cascade"
required-features = ["linux-example"]