mirror of
https://github.com/CloudNebulaProject/wayray.git
synced 2026-04-10 13:10:41 +00:00
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.
This commit is contained in:
parent
974511277b
commit
b805f9f6c8
1 changed files with 5 additions and 1 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue