From ba755c69d648cace61f23537266f2e556ee70c15 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Mon, 3 Feb 2025 03:34:41 +0100 Subject: Fulfill `InputMethod` requests only during `RedrawRequested` --- core/src/shell.rs | 3 +++ winit/src/program.rs | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/src/shell.rs b/core/src/shell.rs index d01233c7..a13492d5 100644 --- a/core/src/shell.rs +++ b/core/src/shell.rs @@ -78,6 +78,9 @@ impl<'a, Message> Shell<'a, Message> { } /// 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>( &mut self, ime: &InputMethod, diff --git a/winit/src/program.rs b/winit/src/program.rs index 302bc6c3..7ead4c3b 100644 --- a/winit/src/program.rs +++ b/winit/src/program.rs @@ -1025,19 +1025,19 @@ async fn run_instance( ); #[cfg(feature = "unconditional-rendering")] - window.raw.request_redraw(); + window.request_redraw( + window::RedrawRequest::NextFrame, + ); match ui_state { user_interface::State::Updated { redraw_request: _redraw_request, - input_method, + .. } => { #[cfg(not( feature = "unconditional-rendering" ))] window.request_redraw(_redraw_request); - - window.request_input_method(input_method); } user_interface::State::Outdated => { uis_stale = true; -- cgit