mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-26 22:21:50 +03:00
wayland: Fix input_handler out of range access (#10724)
The wayland implementation takes an input handler from the state, but only puts it back if the event was an IME key. I flipped the logic to ensure it's always put back. This should fix both: - #10344 - #10652 Release Notes: - Fixed input_handler out of range access ([#10344](https://github.com/zed-industries/zed/issues/10344), [#10652](https://github.com/zed-industries/zed/issues/10652)).
This commit is contained in:
parent
b31df39ab0
commit
15c4c4a308
@ -481,13 +481,12 @@ impl WaylandWindowStatePtr {
|
||||
}
|
||||
}
|
||||
if let PlatformInput::KeyDown(event) = input {
|
||||
if let Some(ime_key) = &event.keystroke.ime_key {
|
||||
let mut state = self.state.borrow_mut();
|
||||
if let Some(mut input_handler) = state.input_handler.take() {
|
||||
if let Some(ime_key) = &event.keystroke.ime_key {
|
||||
drop(state);
|
||||
input_handler.replace_text_in_range(None, ime_key);
|
||||
let mut state = self.state.borrow_mut();
|
||||
state.input_handler = Some(input_handler);
|
||||
self.state.borrow_mut().input_handler = Some(input_handler);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user