From b805f9f6c8031ee93c054c446f54b14218b89773 Mon Sep 17 00:00:00 2001 From: Till Wegmueller Date: Tue, 7 Apr 2026 19:44:39 +0200 Subject: [PATCH] Fix typing lag: use ControlFlow::Poll for continuous frame updates The winit event loop defaulted to Wait mode, only processing frames when user input arrived. Switch to Poll so the loop continuously checks for new frames from the network thread. --- crates/wrclient/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/wrclient/src/main.rs b/crates/wrclient/src/main.rs index 60d52ef..1df4f4b 100644 --- a/crates/wrclient/src/main.rs +++ b/crates/wrclient/src/main.rs @@ -102,7 +102,11 @@ impl ApplicationHandler for App { ); } - fn about_to_wait(&mut self, _event_loop: &ActiveEventLoop) { + fn about_to_wait(&mut self, event_loop: &ActiveEventLoop) { + // Use Poll mode so the event loop continuously checks for new frames + // instead of blocking until user input arrives. + event_loop.set_control_flow(winit::event_loop::ControlFlow::Poll); + // Drain any pending frames from the network thread. let mut got_frame = false; while let Ok(frame) = self.frame_rx.try_recv() {