Skip to content

Commit

Permalink
Plug new_events handler to event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed May 7, 2024
1 parent 2645524 commit 7e7285d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
15 changes: 15 additions & 0 deletions winit/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,21 @@ where
}
}

fn new_events(
&mut self,
event_loop: &winit::event_loop::ActiveEventLoop,
cause: winit::event::StartCause,
) {
if self.boot.is_some() {
return;
}

self.process_event(
event_loop,
winit::event::Event::NewEvents(cause),
);
}

fn window_event(
&mut self,
event_loop: &winit::event_loop::ActiveEventLoop,
Expand Down
15 changes: 15 additions & 0 deletions winit/src/multi_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,21 @@ where
}
}

fn new_events(
&mut self,
event_loop: &winit::event_loop::ActiveEventLoop,
cause: winit::event::StartCause,
) {
if self.boot.is_some() {
return;
}

self.process_event(
event_loop,
Event::EventLoopAwakened(winit::event::Event::NewEvents(cause)),
);
}

fn window_event(
&mut self,
event_loop: &winit::event_loop::ActiveEventLoop,
Expand Down

0 comments on commit 7e7285d

Please sign in to comment.