mirror of
https://github.com/italicsjenga/winit-sonoma-fix.git
synced 2025-01-10 05:01:31 +11:00
461efaf99f
The implementation of `pump_events` essentially works by hooking into the `RunLoopObserver` and requesting that the app should be stopped the next time that the `RunLoop` prepares to wait for new events. Originally I had thought I would poke the `CFRunLoop` for the app directly and I was originally going to implement `pump_events` based on a timeout which I'd seen SDL doing. I found that `[NSApp run]` wasn't actually being stopped by asking the RunLoop to stop directly and inferred that `NSApp run` will actually catch this and re-start the loop. Hooking into the observer and calling `[NSApp stop]` actually seems like a better solution that doesn't need a hacky constant timeout. The end result is quite similar to what happens with existing apps that call `run_return` inside an external loop and cause the loop to exit for each iteration (that also results in the `NSApp` stopping each iteration). |
||
---|---|---|
.. | ||
platform | ||
platform_impl | ||
dpi.rs | ||
error.rs | ||
event.rs | ||
event_loop.rs | ||
icon.rs | ||
keyboard.rs | ||
lib.rs | ||
monitor.rs | ||
window.rs |