Lifetimes don't work nicely when dealing with multithreaded environments
in the current design of the existing winit's event handling model, so
remove it in favor of `InnerSizeWriter` fences passed to client, so they
could try to update the size.
Fixes#1387.
This adds two new extensions for running a Winit event loop which will
replace `EventLoopExtRunReturn`
The `run_return` API is trying to solve multiple problems and address
multiple, unrelated, use cases but in doing so it is not succeeding
at addressing any of them fully.
The notable use cases we have are:
1. Applications want to be able to implement their own external
event loop and call some Winit API to poll / pump events, once
per iteration of their own loop, without blocking the outer,
external loop. Addressing #2706
2. Applications want to be able to re-run separate instantiations
of some Winit-based GUI and want to allow the event loop to exit with
a status, and then later be able to run the loop again for a new
instantiation of their GUI. Addressing #2431
It's very notable that these use cases can't be supported across
all platforms and so they are extensions, similar to
`EventLoopExtRunReturn`
The intention is to support these extensions on:
- Windows
- Linux (X11 + Wayland)
- macOS
- Android
These extensions aren't compatible with Web or iOS though.
Each method of running the loop will behave consistently in terms of how
`NewEvents(Init)`, `Resumed` and `LoopDestroyed` events are dispatched
(so portable application code wouldn't necessarily need to have any awareness
of which method of running the loop was being used)
Once all backends have support for these extensions then we can
remove `EventLoopExtRunReturn`
For simplicity, the extensions are documented with the assumption that
the above platforms will be supported.
This patch makes no functional change, it only introduces these new
extensions so we can then handle adding platform-specific backends
in separate pull requests, so the work can be landed in stages.
* Format everything and add rustfmt to travis
* Remove extern crate winit from examples and add force_multiline_blocks
* Format the code properly
* Fix inconsistent period in PULL_REQUEST_TEMPLATE.md
* Only run rustfmt on nightly
* Travis fixings
* First name consistency pass. More to come!
* Remove multitouch variable (hopefully this compiles!)
* Remove CreationError::NotSupported
* Add new error handling types
* Remove `get_` prefix from getters.
This is as per the Rust naming conventions recommended in
https://rust-lang-nursery.github.io/api-guidelines/naming.html#getter-names-follow-rust-convention-c-getter
* Make changes to Window position and size function signatures
* Remove CreationError in favor of OsError
* Begin updating iOS backend
* Change MonitorHandle::outer_position to just position
* Fix build on Windows and Linux
* Add Display and Error implementations to Error types
* Attempt to fix iOS build.
I can't actually check that this works since I can't cross-compile to
iOS on a Windows machine (thanks apple :/) but this should be one of
several commits to get it working.
* Attempt to fix iOS errors, and muck up Travis to make debugging easier
* More iOS fixins
* Add Debug and Display impls to OsError
* Fix Display impl
* Fix unused code warnings and travis
* Rename set_ime_spot to set_ime_position
* Add CHANGELOG entry
* Rename set_cursor to set_cursor_icon and MouseCursor to CursorIcon
* Organize Window functions into multiple, categorized impls
* Improve clarity of function ordering and docs in EventLoop