winit-sonoma-fix/examples
Robert Bragg 0d366ffbda Re-work event loop run() API so it can return a Result
This re-works the portable `run()` API that consumes the `EventLoop` and
runs the loop on the calling thread until the app exits.

This can be supported across _all_ platforms and compared to the
previous `run() -> !` API is now able to return a `Result` status on all
platforms except iOS and Web. Fixes: #2709

By moving away from `run() -> !` we stop calling `std::process::exit()`
internally as a means to kill the process without returning which means
it's possible to return an exit status and applications can return from
their `main()` function normally.

This also fixes Android support where an Activity runs in a thread but
we can't assume to have full ownership of the process (other services
could be running in separate threads).

Additionally all examples have generally been updated so that `main()`
returns a `Result` from `run()`

Fixes: #2709
2023-07-28 03:04:32 +04:00
..
util Disallow cleanup for TLS in examples 2023-06-26 01:04:38 +04:00
child_window.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
control_flow.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
cursor.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
cursor_grab.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
custom_events.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
drag_window.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
fullscreen.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
handling_close.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
icon.png Window icons (#497) 2018-05-07 17:36:21 -04:00
ime.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
key_binding.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
monitor_list.rs Properly print outputs in monitor_list example 2023-01-30 14:17:41 +03:00
mouse_wheel.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
multithreaded.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
multiwindow.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
request_redraw.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
request_redraw_threaded.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
resizable.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
startup_notification.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
theme.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
timer.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
touchpad_gestures.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
transparent.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
video_modes.rs Fix clippy issues on stable 2023-01-27 07:18:58 +03:00
web.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
web_aspect_ratio.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_buttons.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_debug.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_drag_resize.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_icon.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_option_as_alt.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_resize_increments.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00
window_tabbing.rs Re-work event loop run() API so it can return a Result 2023-07-28 03:04:32 +04:00