Under the hood both Unix backends use calloop, which supports registering arbitrary file descriptors through the polling crate. However, winit usually isn't the only thing running in the GUI system; there's also zbus, accesskit and other things. It would be nice if you could register these systems into winit and poll them without needing to spawn another thread.
Two potential options here:
- Expose a way to register file descriptors in
calloop, then receive events as normal through the winit event loop. Then expose a higher-level I/O mechanism in another crate.
- Port from
calloop to async-io. This would take a lot more work and be more controversial, but it would allow for seamless integration with zbus.
cc AccessKit/accesskit#337 (comment), @mwcampbell
Under the hood both Unix backends use
calloop, which supports registering arbitrary file descriptors through thepollingcrate. However,winitusually isn't the only thing running in the GUI system; there's alsozbus,accesskitand other things. It would be nice if you could register these systems intowinitand poll them without needing to spawn another thread.Two potential options here:
calloop, then receive events as normal through thewinitevent loop. Then expose a higher-level I/O mechanism in another crate.callooptoasync-io. This would take a lot more work and be more controversial, but it would allow for seamless integration withzbus.cc AccessKit/accesskit#337 (comment), @mwcampbell