Skip to content

On Unix, expose a way to register file descriptors into the polling loop #3592

@notgull

Description

@notgull

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    D - hardLikely harder than most tasks hereDS - waylandAffects the Wayland backend, or generally free Unix platformsDS - x11Affects the X11 backend, or generally free Unix platformsS - apiDesign and usability

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions