Fulfill InputMethod requests only during RedrawRequested
This commit is contained in:
parent
c9abe25d31
commit
ba755c69d6
2 changed files with 7 additions and 4 deletions
|
|
@ -78,6 +78,9 @@ impl<'a, Message> Shell<'a, Message> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Requests the current [`InputMethod`] strategy.
|
/// Requests the current [`InputMethod`] strategy.
|
||||||
|
///
|
||||||
|
/// __Important__: This request will only be honored by the
|
||||||
|
/// [`Shell`] only during a [`window::Event::RedrawRequested`].
|
||||||
pub fn request_input_method<T: AsRef<str>>(
|
pub fn request_input_method<T: AsRef<str>>(
|
||||||
&mut self,
|
&mut self,
|
||||||
ime: &InputMethod<T>,
|
ime: &InputMethod<T>,
|
||||||
|
|
|
||||||
|
|
@ -1025,19 +1025,19 @@ async fn run_instance<P, C>(
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(feature = "unconditional-rendering")]
|
#[cfg(feature = "unconditional-rendering")]
|
||||||
window.raw.request_redraw();
|
window.request_redraw(
|
||||||
|
window::RedrawRequest::NextFrame,
|
||||||
|
);
|
||||||
|
|
||||||
match ui_state {
|
match ui_state {
|
||||||
user_interface::State::Updated {
|
user_interface::State::Updated {
|
||||||
redraw_request: _redraw_request,
|
redraw_request: _redraw_request,
|
||||||
input_method,
|
..
|
||||||
} => {
|
} => {
|
||||||
#[cfg(not(
|
#[cfg(not(
|
||||||
feature = "unconditional-rendering"
|
feature = "unconditional-rendering"
|
||||||
))]
|
))]
|
||||||
window.request_redraw(_redraw_request);
|
window.request_redraw(_redraw_request);
|
||||||
|
|
||||||
window.request_input_method(input_method);
|
|
||||||
}
|
}
|
||||||
user_interface::State::Outdated => {
|
user_interface::State::Outdated => {
|
||||||
uis_stale = true;
|
uis_stale = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue