diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index b36c6a11717b734829901970a6974b052e3702b9..95c4ae65e0b41f85ccf9067dbab1044f6d9b6d4f 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -29,6 +29,9 @@ use crate::{ Point, Result, Task, WindowAppearance, WindowParams, px, }; +#[cfg(any(feature = "wayland", feature = "x11"))] +use super::LinuxKeyboardMapper; + #[cfg(any(feature = "wayland", feature = "x11"))] pub(crate) const SCROLL_LINES: f32 = 3.0; @@ -706,6 +709,20 @@ pub(super) fn log_cursor_icon_warning(message: impl std::fmt::Display) { } } +#[cfg(any(feature = "wayland", feature = "x11"))] +struct KeyboardState { + state: xkb::State, + mapper: LinuxKeyboardMapper, +} + +#[cfg(any(feature = "wayland", feature = "x11"))] +impl KeyboardState { + fn new(state: xkb::State) -> Self { + let mapper = LinuxKeyboardMapper::new(&state); + Self { state, mapper } + } +} + #[cfg(any(feature = "wayland", feature = "x11"))] impl crate::Keystroke { pub(super) fn from_xkb(