Skip to content

Commit

Permalink
turns out we also need to reset on focus_out
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindful committed Oct 21, 2024
1 parent bdf581f commit a043fc0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ibus_eei_engine_class_init (IBusEEIEngineClass *klass)
engine_class->page_up = ibus_eei_engine_page_up_button;
engine_class->candidate_clicked = ibus_eei_engine_candidate_clicked;
engine_class->reset = ibus_eei_engine_reset;
engine_class->focus_out = ibus_eei_engine_focus_out;
engine_class->enable = ibus_eei_engine_enable;
}

Expand Down
19 changes: 19 additions & 0 deletions src/predict/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,25 @@ 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) {
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);
}
None => {
log::error!("Could not retrieve parent function for focus out")
}
}
}
None => {
log::error!("Could not retrieve engine core for focus out");
}
}
}

#[no_mangle]
pub unsafe extern "C" fn ibus_eei_engine_reset(engine: *mut IBusEngine) {
Expand Down

0 comments on commit a043fc0

Please sign in to comment.