Wayland: Keyboard input improvements (#7989)
Release Notes: - N/A --- Right now the Wayland backend is using `xkb::State::key_get_utf8` as the `key`, when it should be used as the `ime_key`. It also manages pressing/releasing modifiers manually when this should be managed by the display server. This allows modifier combinations to work in more cases, making it an alternative to https://github.com/zed-industries/zed/pull/7975, which interprets what is now only used as the `ime_key` value as a `key` value.
This commit is contained in:
parent
bd137b01ad
commit
2b56c43f2d
2 changed files with 41 additions and 81 deletions
|
@ -71,8 +71,8 @@ impl WaylandWindowInner {
|
|||
bounds: Bounds<i32>,
|
||||
) -> Self {
|
||||
let raw = RawWindow {
|
||||
window: wl_surf.id().as_ptr() as *mut _,
|
||||
display: conn.backend().display_ptr() as *mut _,
|
||||
window: wl_surf.id().as_ptr().cast::<c_void>(),
|
||||
display: conn.backend().display_ptr().cast::<c_void>(),
|
||||
};
|
||||
let gpu = Arc::new(
|
||||
unsafe {
|
||||
|
@ -204,7 +204,9 @@ impl WaylandWindowState {
|
|||
if let PlatformInput::KeyDown(event) = input {
|
||||
let mut inner = self.inner.lock();
|
||||
if let Some(ref mut input_handler) = inner.input_handler {
|
||||
input_handler.replace_text_in_range(None, &event.keystroke.key);
|
||||
if let Some(ime_key) = &event.keystroke.ime_key {
|
||||
input_handler.replace_text_in_range(None, ime_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue