winit-sonoma-fix/src
Robert Bragg 6cdb3179c8
Consistently deliver a Resumed event on all platforms
To be more consistent with mobile platforms this updates the Windows,
macOS, Wayland, X11 and Web backends to all emit a Resumed event
immediately after the initial `NewEvents(StartCause::Init)` event.

The documentation for Suspended and Resumed has also been updated
to provide general recommendations for how to handle Suspended and
Resumed events in portable applications as well as providing
Android and iOS specific details.

This consistency makes it possible to write applications that lazily
initialize their graphics state when the application resumes without
any platform-specific knowledge. Previously, applications that wanted
to run on Android and other systems would have to maintain two,
mutually-exclusive, initialization paths.

Note: This patch does nothing to guarantee that Suspended events will
be delivered. It's still reasonable to say that most OSs without a
formal lifecycle for applications will simply never "suspend" your
application. There are currently no known portability issues caused
by not delivering `Suspended` events consistently and technically
it's not possible to guarantee the delivery of `Suspended` events if
the OS doesn't define an application lifecycle. (app can always be
terminated without any kind of clean up notification on most
non-mobile OSs)

Fixes #2185.

Co-authored-by: Marijn Suijten <marijns95@gmail.com>
Co-authored-by: Markus Røyset <maroider@protonmail.com>
2022-07-26 16:03:12 +03:00
..
platform Fix type hint reference for xlib hook 2022-07-26 16:02:09 +03:00
platform_impl Consistently deliver a Resumed event on all platforms 2022-07-26 16:03:12 +03:00
dpi.rs Fix typos (#2375) 2022-07-15 18:32:12 +02:00
error.rs Always use f as the argument name for &mut std::fmt::Formatter (#1023) 2019-07-09 17:49:07 -04:00
event.rs Consistently deliver a Resumed event on all platforms 2022-07-26 16:03:12 +03:00
event_loop.rs Update raw-window-handle to v0.5.0 2022-07-21 22:22:36 +03:00
icon.rs Documentation cleanup (#2328) 2022-06-11 18:57:19 +02:00
lib.rs Update raw-window-handle to v0.5.0 2022-07-21 22:22:36 +03:00
monitor.rs Add refresh_rate_millihertz for MonitorHandle 2022-07-08 13:25:56 +03:00
window.rs Update raw-window-handle to v0.5.0 2022-07-21 22:22:36 +03:00