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:
Dorota Czaplejewicz
2020-12-15 12:49:44 +00:00
parent b72c6b53e4
commit 914c5d4940

View File

@ -151,14 +151,19 @@ pub mod c {
if active_changed { if active_changed {
(imservice.active_callback)(imservice.current.active); (imservice.active_callback)(imservice.current.active);
if imservice.current.active { let (hint, purpose) = if imservice.current.active {(
unsafe { imservice.current.content_hint,
eekboard_context_service_set_hint_purpose( imservice.current.content_purpose.clone(),
imservice.state_manager, )} else {(
imservice.current.content_hint.bits(), ContentHint::NONE,
imservice.current.content_purpose.clone() as u32, ContentPurpose::Normal,
); )};
} unsafe {
eekboard_context_service_set_hint_purpose(
imservice.state_manager,
hint.bits(),
purpose as u32,
);
} }
} }
} }