Move Event::RedrawRequested to WindowEvent (#3049)

This commit is contained in:
daxpedda 2023-08-27 16:15:09 +02:00 committed by GitHub
parent a3cba838ea
commit 67d3fd28f7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 572 additions and 562 deletions

View file

@ -564,8 +564,10 @@ impl AppState {
// Redraw request might come out of order from the OS.
// -> Don't go back into the callback when our callstack originates from there
if !HANDLER.in_callback.swap(true, Ordering::AcqRel) {
HANDLER
.handle_nonuser_event(EventWrapper::StaticEvent(Event::RedrawRequested(window_id)));
HANDLER.handle_nonuser_event(EventWrapper::StaticEvent(Event::WindowEvent {
window_id,
event: WindowEvent::RedrawRequested,
}));
HANDLER.set_in_callback(false);
// `pump_events` will request to stop immediately _after_ dispatching RedrawRequested events
@ -616,8 +618,10 @@ impl AppState {
}
for window_id in HANDLER.should_redraw() {
HANDLER
.handle_nonuser_event(EventWrapper::StaticEvent(Event::RedrawRequested(window_id)));
HANDLER.handle_nonuser_event(EventWrapper::StaticEvent(Event::WindowEvent {
window_id,
event: WindowEvent::RedrawRequested,
}));
}
HANDLER.handle_nonuser_event(EventWrapper::StaticEvent(Event::AboutToWait));