winit-sonoma-fix/src
Robert Bragg 461efaf99f MacOS: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand
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).
2023-07-28 03:04:32 +04:00
..
platform MacOS: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand 2023-07-28 03:04:32 +04:00
platform_impl MacOS: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand 2023-07-28 03:04:32 +04:00
dpi.rs Implement PartialOrd/Ord for dpi module types 2023-05-16 05:11:43 +03:00
error.rs Add EventLoopExtPumpEvents and EventLoopExtRunOnDemand 2023-07-28 03:04:32 +04:00
event.rs Add platform::startup_notify for Wayland/X11 2023-07-20 13:16:51 +00:00
event_loop.rs Add platform::startup_notify for Wayland/X11 2023-07-20 13:16:51 +00:00
icon.rs Fix clippy issues on stable 2023-01-27 07:18:58 +03:00
keyboard.rs Implement PartialOrd/Ord for KeyCode/NativeKeyCode 2023-07-01 19:07:35 +04:00
lib.rs Overhaul the Keyboard API 2023-05-28 21:02:59 +03:00
monitor.rs Implement PartialOrd/Ord for dpi module types 2023-05-16 05:11:43 +03:00
window.rs Windows: Implement EventLoopExtPumpEvents and EventLoopExtRunOnDemand 2023-07-28 03:04:32 +04:00