Skip to content

Commit

Permalink
Merge pull request #18 from pythonbrad/patch_reset
Browse files Browse the repository at this point in the history
reset the IME when the user stop typing
  • Loading branch information
Mindful authored Oct 20, 2024
2 parents 61ec255 + 16cefdf commit bdf581f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion apps/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ ibus_eei_engine_class_init (IBusEEIEngineClass *klass)
engine_class->page_down = ibus_eei_engine_page_down_button;
engine_class->page_up = ibus_eei_engine_page_up_button;
engine_class->candidate_clicked = ibus_eei_engine_candidate_clicked;
engine_class->focus_out = ibus_eei_engine_focus_out;
engine_class->reset = ibus_eei_engine_reset;
engine_class->enable = ibus_eei_engine_enable;
}

Expand Down
12 changes: 6 additions & 6 deletions src/predict/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,21 +444,21 @@ pub unsafe extern "C" fn ibus_eei_engine_page_up_button(engine: *mut IBusEngine)
}

#[no_mangle]
pub unsafe extern "C" fn ibus_eei_engine_focus_out(engine: *mut IBusEngine) {
pub unsafe extern "C" fn ibus_eei_engine_reset(engine: *mut IBusEngine) {
match EngineCore::get(engine) {
Some(engine_core) => {
engine_core.abort_table_input();
match (*engine_core.parent_engine_class).focus_out {
Some(parent_focus_out) => {
parent_focus_out(engine);
match (*engine_core.parent_engine_class).reset {
Some(parent_reset) => {
parent_reset(engine);
}
None => {
log::error!("Could not retrieve parent function for focus out")
log::error!("Could not retrieve parent function for reset")
}
}
}
None => {
log::error!("Could not retrieve engine core for focus out");
log::error!("Could not retrieve engine core for reset");
}
}
}
Expand Down

0 comments on commit bdf581f

Please sign in to comment.