linux: Fix IME panel position while enumerating input methods (#12495)
Release Notes: - N/A This updates the IME position every time the selection changes, this is probably only useful when you enumerate languages with your IME. TODO: - ~There is a rare chance that the ime panel is not updated because the window input handler is None.~ - ~Update IME panel in vim mode.~ - ~Update IME panel when leaving Buffer search input.~ --------- Co-authored-by: Mikayla Maki <mikayla@zed.dev>
This commit is contained in:
parent
e6d5f4406f
commit
8e8927db4b
21 changed files with 244 additions and 55 deletions
|
@ -3575,6 +3575,18 @@ impl<'a> WindowContext<'a> {
|
|||
self.window.platform_window.toggle_fullscreen();
|
||||
}
|
||||
|
||||
/// Updates the IME panel position suggestions for languages like japanese, chinese.
|
||||
pub fn invalidate_character_coordinates(&mut self) {
|
||||
self.on_next_frame(|cx| {
|
||||
if let Some(mut input_handler) = cx.window.platform_window.take_input_handler() {
|
||||
if let Some(bounds) = input_handler.selected_bounds(cx) {
|
||||
cx.window.platform_window.update_ime_position(bounds);
|
||||
}
|
||||
cx.window.platform_window.set_input_handler(input_handler);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/// Present a platform dialog.
|
||||
/// The provided message will be presented, along with buttons for each answer.
|
||||
/// When a button is clicked, the returned Receiver will receive the index of the clicked button.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue