rust-windowing / rust-windowing/winit

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

Open
#3,592 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

D - hard DS - wayland DS - x11 S - api
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

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 https://github.com/AccessKit/accesskit/pull/337#issuecomment-2002494310, @mwcampbell

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the two Unix backends and their calloop event-loop integration, then compare calloop's polling support with the proposed async-io approach. The issue requires choosing between these designs before implementation; done would mean a supported way to integrate external file descriptors and receive their events through winit without another thread.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop-dev, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.