Make ControlFlow::Wait the default (#3106)

This commit is contained in:
daxpedda
2023-09-22 21:27:11 +02:00
committed by Kirill Chibisov
parent c5cef46060
commit 220a2d32d5
34 changed files with 154 additions and 228 deletions

View File

@@ -4,7 +4,7 @@
use winit::{
dpi::LogicalSize,
event::{ElementState, Event, WindowEvent},
event_loop::{ControlFlow, EventLoop},
event_loop::EventLoop,
keyboard::{Key, ModifiersState},
// WARNING: This is not available on all platforms (for example on the web).
platform::modifier_supplement::KeyEventExtModifierSupplement,
@@ -32,8 +32,6 @@ fn main() -> Result<(), impl std::error::Error> {
let mut modifiers = ModifiersState::default();
event_loop.run(move |event, elwt| {
elwt.set_control_flow(ControlFlow::Wait);
if let Event::WindowEvent { event, .. } = event {
match event {
WindowEvent::CloseRequested => elwt.exit(),