text input: Reset hints when text input gone
This ensures that when the keyboard is force brought up next time, the user is not stuck with an overlay they can't switch. As a downside, there's a blink of default hint before the keyboard hides.
This commit is contained in:
@ -151,17 +151,22 @@ pub mod c {
|
||||
|
||||
if active_changed {
|
||||
(imservice.active_callback)(imservice.current.active);
|
||||
if imservice.current.active {
|
||||
let (hint, purpose) = if imservice.current.active {(
|
||||
imservice.current.content_hint,
|
||||
imservice.current.content_purpose.clone(),
|
||||
)} else {(
|
||||
ContentHint::NONE,
|
||||
ContentPurpose::Normal,
|
||||
)};
|
||||
unsafe {
|
||||
eekboard_context_service_set_hint_purpose(
|
||||
imservice.state_manager,
|
||||
imservice.current.content_hint.bits(),
|
||||
imservice.current.content_purpose.clone() as u32,
|
||||
hint.bits(),
|
||||
purpose as u32,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: this is really untested
|
||||
#[no_mangle]
|
||||
|
||||
Reference in New Issue
Block a user