diff --git a/Cargo.lock b/Cargo.lock index 3d6734a..a39d1d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1898,12 +1898,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -2489,12 +2483,14 @@ checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" [[package]] name = "reis" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00939c5c526a1b4054ef8d9d96b3f92227f08ca355965e986741b556eda6d289" +checksum = "81f3fedd2777cde52c1be5e572efbec485eac7b801c47820eda388d4f13b9c4b" dependencies = [ - "futures", - "rustix 0.38.44", + "enumflags2", + "futures-util", + "log", + "rustix", "tokio", ] @@ -2540,19 +2536,6 @@ dependencies = [ "nom", ] -[[package]] -name = "rustix" -version = "0.38.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" -dependencies = [ - "bitflags 2.11.0", - "errno", - "libc", - "linux-raw-sys 0.4.15", - "windows-sys 0.59.0", -] - [[package]] name = "rustix" version = "1.1.4" @@ -2562,7 +2545,7 @@ dependencies = [ "bitflags 2.11.0", "errno", "libc", - "linux-raw-sys 0.12.1", + "linux-raw-sys", "windows-sys 0.61.2", ] @@ -2880,7 +2863,7 @@ dependencies = [ "fastrand", "getrandom 0.4.2", "once_cell", - "rustix 1.1.4", + "rustix", "windows-sys 0.61.2", ] @@ -3388,7 +3371,7 @@ checksum = "2857dd20b54e916ec7253b3d6b4d5c4d7d4ca2c33c2e11c6c76a99bd8744755d" dependencies = [ "cc", "downcast-rs", - "rustix 1.1.4", + "rustix", "smallvec", "wayland-sys", ] @@ -3400,7 +3383,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "645c7c96bb74690c3189b5c9cb4ca1627062bb23693a4fad9d8c3de958260144" dependencies = [ "bitflags 2.11.0", - "rustix 1.1.4", + "rustix", "wayland-backend", "wayland-scanner", ] @@ -4065,7 +4048,7 @@ dependencies = [ "hex", "libc", "ordered-stream", - "rustix 1.1.4", + "rustix", "serde", "serde_repr", "tokio", diff --git a/input-capture/Cargo.toml b/input-capture/Cargo.toml index 2f270b6..75414ff 100644 --- a/input-capture/Cargo.toml +++ b/input-capture/Cargo.toml @@ -45,7 +45,7 @@ ashpd = { version = "0.13.9", default-features = false, features = [ "input_capture", "tokio", ], optional = true } -reis = { version = "0.5.0", features = ["tokio"], optional = true } +reis = { version = "0.7.0", features = ["tokio"], optional = true } [target.'cfg(target_os="macos")'.dependencies] core-graphics = { version = "0.25.0", features = ["highsierra"] } diff --git a/input-capture/src/libei.rs b/input-capture/src/libei.rs index fa16895..42b8fbe 100644 --- a/input-capture/src/libei.rs +++ b/input-capture/src/libei.rs @@ -529,15 +529,6 @@ fn distance_to_line(line: ((f32, f32), (f32, f32)), p: (f32, f32)) -> f32 { distance } -static ALL_CAPABILITIES: &[DeviceCapability] = &[ - DeviceCapability::Pointer, - DeviceCapability::PointerAbsolute, - DeviceCapability::Keyboard, - DeviceCapability::Touch, - DeviceCapability::Scroll, - DeviceCapability::Button, -]; - async fn handle_ei_event( ei_event: EiEvent, current_client: Option, @@ -545,9 +536,15 @@ async fn handle_ei_event( event_tx: &Sender<(Position, CaptureEvent)>, release_session: &Notify, ) -> Result<(), CaptureError> { + let all_capabilities = DeviceCapability::Pointer + | DeviceCapability::PointerAbsolute + | DeviceCapability::Keyboard + | DeviceCapability::Touch + | DeviceCapability::Scroll + | DeviceCapability::Button; match ei_event { EiEvent::SeatAdded(s) => { - s.seat.bind_capabilities(ALL_CAPABILITIES); + s.seat.bind_capabilities(all_capabilities); context.flush().map_err(|e| io::Error::new(e.kind(), e))?; } EiEvent::SeatRemoved(_) | /* EiEvent::DeviceAdded(_) | */ EiEvent::DeviceRemoved(_) => { diff --git a/input-emulation/Cargo.toml b/input-emulation/Cargo.toml index a94c93b..14385fd 100644 --- a/input-emulation/Cargo.toml +++ b/input-emulation/Cargo.toml @@ -45,7 +45,7 @@ ashpd = { version = "0.13.9", default-features = false, features = [ "screencast", "tokio", ], optional = true } -reis = { version = "0.5.0", features = ["tokio"], optional = true } +reis = { version = "0.7.0", features = ["tokio"], optional = true } [target.'cfg(target_os="macos")'.dependencies] bitflags = "2.6.0" diff --git a/input-emulation/src/libei.rs b/input-emulation/src/libei.rs index 3ac6e89..0042a2a 100644 --- a/input-emulation/src/libei.rs +++ b/input-emulation/src/libei.rs @@ -291,14 +291,12 @@ async fn ei_event_handler( ) -> Result<(), EmulationError> { loop { let event = events.next().await.ok_or(EmulationError::EndOfStream)??; - const CAPABILITIES: &[DeviceCapability] = &[ - DeviceCapability::Pointer, - DeviceCapability::PointerAbsolute, - DeviceCapability::Keyboard, - DeviceCapability::Touch, - DeviceCapability::Scroll, - DeviceCapability::Button, - ]; + let capabilities = DeviceCapability::Pointer + | DeviceCapability::PointerAbsolute + | DeviceCapability::Keyboard + | DeviceCapability::Touch + | DeviceCapability::Scroll + | DeviceCapability::Button; log::debug!("{event:?}"); match event { EiEvent::Disconnected(e) => { @@ -306,7 +304,7 @@ async fn ei_event_handler( return Err(EmulationError::EndOfStream); } EiEvent::SeatAdded(e) => { - e.seat().bind_capabilities(CAPABILITIES); + e.seat().bind_capabilities(capabilities); } EiEvent::SeatRemoved(e) => { log::debug!("seat removed: {:?}", e.seat()); @@ -314,7 +312,6 @@ async fn ei_event_handler( EiEvent::DeviceAdded(e) => { let device_type = e.device().device_type(); log::debug!("device added: {device_type:?}"); - e.device().device(); let device = e.device(); if let Some(pointer) = e.device().interface::() { devices diff --git a/input-event/Cargo.toml b/input-event/Cargo.toml index 68beeae..fa554e8 100644 --- a/input-event/Cargo.toml +++ b/input-event/Cargo.toml @@ -14,7 +14,7 @@ serde = { version = "1.0", features = ["derive"] } thiserror = "2.0.0" [target.'cfg(all(unix, not(target_os="macos")))'.dependencies] -reis = { version = "0.5.0", optional = true } +reis = { version = "0.7.0", optional = true } [features] default = ["libei"]