mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2024-12-23 13:51:30 +11:00
Bump smithay-client-toolkit to v0.16.0
This commit is contained in:
parent
2b414cd825
commit
c93ef47b9b
|
@ -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 }
|
||||
|
|
|
@ -538,6 +538,8 @@ impl<T: 'static> EventLoop<T> {
|
|||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
self.event_loop.dispatch(timeout, state)
|
||||
self.event_loop
|
||||
.dispatch(timeout, state)
|
||||
.map_err(|error| error.into())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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<RegistrationToken>,
|
||||
|
||||
/// 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<RefCell<ModifiersState>>,
|
||||
) -> Option<Self> {
|
||||
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::<WinitState>().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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue