mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-02-24 00:37:43 +11:00
Fix compiler warning of potential undefined behavior (#892)
This commit is contained in:
parent
08f8f89702
commit
0eefa3ba42
1 changed files with 2 additions and 1 deletions
|
@ -844,13 +844,14 @@ unsafe extern "system" fn public_window_callback<T>(
|
||||||
// spinning up a new event loop iteration. We do this because that's what the API
|
// spinning up a new event loop iteration. We do this because that's what the API
|
||||||
// says to do.
|
// says to do.
|
||||||
let control_flow = runner.control_flow;
|
let control_flow = runner.control_flow;
|
||||||
|
let runner_state = runner.runner_state;
|
||||||
let mut request_redraw = || {
|
let mut request_redraw = || {
|
||||||
runner.call_event_handler(Event::WindowEvent {
|
runner.call_event_handler(Event::WindowEvent {
|
||||||
window_id: RootWindowId(WindowId(window)),
|
window_id: RootWindowId(WindowId(window)),
|
||||||
event: RedrawRequested,
|
event: RedrawRequested,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
match runner.runner_state {
|
match runner_state {
|
||||||
RunnerState::Idle(..) |
|
RunnerState::Idle(..) |
|
||||||
RunnerState::DeferredNewEvents(..) => request_redraw(),
|
RunnerState::DeferredNewEvents(..) => request_redraw(),
|
||||||
RunnerState::HandlingEvents => {
|
RunnerState::HandlingEvents => {
|
||||||
|
|
Loading…
Add table
Reference in a new issue