windows: Fix Japanese IME (#32153)
Fixed an issue where pressing `Escape` wouldn’t clear all pre-edit text when using Japanese IME. Release Notes: - N/A
This commit is contained in:
parent
244d8517f1
commit
c71791d64e
1 changed files with 8 additions and 0 deletions
|
@ -679,6 +679,14 @@ fn handle_ime_composition_inner(
|
||||||
lparam: LPARAM,
|
lparam: LPARAM,
|
||||||
state_ptr: Rc<WindowsWindowStatePtr>,
|
state_ptr: Rc<WindowsWindowStatePtr>,
|
||||||
) -> Option<isize> {
|
) -> Option<isize> {
|
||||||
|
if lparam.0 == 0 {
|
||||||
|
// Japanese IME may send this message with lparam = 0, which indicates that
|
||||||
|
// there is no composition string.
|
||||||
|
with_input_handler(&state_ptr, |input_handler| {
|
||||||
|
input_handler.replace_text_in_range(None, "");
|
||||||
|
})?;
|
||||||
|
return Some(0);
|
||||||
|
}
|
||||||
let mut ime_input = None;
|
let mut ime_input = None;
|
||||||
if lparam.0 as u32 & GCS_COMPSTR.0 > 0 {
|
if lparam.0 as u32 & GCS_COMPSTR.0 > 0 {
|
||||||
let comp_string = parse_ime_compostion_string(ctx)?;
|
let comp_string = parse_ime_compostion_string(ctx)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue