diff --git a/Cargo.toml b/Cargo.toml index 8709e748..ce8b35d1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,8 +102,8 @@ features = [ [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd", target_os = "openbsd", target_os = "netbsd"))'.dependencies] wayland-client = { version = "0.29.4", default_features = false, features = ["use_system_lib"], optional = true } wayland-protocols = { version = "0.29.4", features = [ "staging_protocols"], optional = true } -sctk = { package = "smithay-client-toolkit", version = "0.15.4", default_features = false, features = ["calloop"], optional = true } -sctk-adwaita = { version = "0.3.5", optional = true } +sctk = { package = "smithay-client-toolkit", version = "0.16.0", default_features = false, features = ["calloop"], optional = true } +sctk-adwaita = { version = "0.4.0", optional = true } mio = { version = "0.8", features = ["os-ext"], optional = true } x11-dl = { version = "2.18.5", optional = true } percent-encoding = { version = "2.0", optional = true } diff --git a/src/platform_impl/linux/wayland/event_loop/mod.rs b/src/platform_impl/linux/wayland/event_loop/mod.rs index 0f879ea2..b2948a9b 100644 --- a/src/platform_impl/linux/wayland/event_loop/mod.rs +++ b/src/platform_impl/linux/wayland/event_loop/mod.rs @@ -538,6 +538,8 @@ impl EventLoop { _ => unreachable!(), }; - self.event_loop.dispatch(timeout, state) + self.event_loop + .dispatch(timeout, state) + .map_err(|error| error.into()) } } diff --git a/src/platform_impl/linux/wayland/seat/keyboard/mod.rs b/src/platform_impl/linux/wayland/seat/keyboard/mod.rs index c6e0ad45..262a014b 100644 --- a/src/platform_impl/linux/wayland/seat/keyboard/mod.rs +++ b/src/platform_impl/linux/wayland/seat/keyboard/mod.rs @@ -7,7 +7,7 @@ use sctk::reexports::client::protocol::wl_keyboard::WlKeyboard; use sctk::reexports::client::protocol::wl_seat::WlSeat; use sctk::reexports::client::Attached; -use sctk::reexports::calloop::{LoopHandle, RegistrationToken}; +use sctk::reexports::calloop::LoopHandle; use sctk::seat::keyboard; @@ -20,12 +20,6 @@ mod keymap; pub(crate) struct Keyboard { pub keyboard: WlKeyboard, - - /// The source for repeat keys. - pub repeat_token: Option, - - /// LoopHandle to drop `RepeatSource`, when dropping the keyboard. - pub loop_handle: LoopHandle<'static, WinitState>, } impl Keyboard { @@ -35,7 +29,7 @@ impl Keyboard { modifiers_state: Rc>, ) -> Option { let mut inner = KeyboardInner::new(modifiers_state); - let keyboard_data = keyboard::map_keyboard_repeat( + let keyboard = keyboard::map_keyboard_repeat( loop_handle.clone(), seat, None, @@ -44,15 +38,10 @@ impl Keyboard { let winit_state = dispatch_data.get::().unwrap(); handlers::handle_keyboard(event, &mut inner, winit_state); }, - ); + ) + .ok()?; - let (keyboard, repeat_token) = keyboard_data.ok()?; - - Some(Self { - keyboard, - loop_handle, - repeat_token: Some(repeat_token), - }) + Some(Self { keyboard }) } } @@ -61,10 +50,6 @@ impl Drop for Keyboard { if self.keyboard.as_ref().version() >= 3 { self.keyboard.release(); } - - if let Some(repeat_token) = self.repeat_token.take() { - self.loop_handle.remove(repeat_token); - } } }