rust-windowing / rust-windowing/winit

Seat identifiers on x11/wayland

Open
#795 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C - needs discussion DS - wayland DS - x11 S - enhancement
Dominant language
Rust
Stars
6.2k
Forks
1.3k
Avg merge
2d 19h
Merged PRs (30d)
9

Description

Wayland is a multi-seat aware protocol, and I believe x11 is too. From this, I think it could be reasonable to add a platform specific extension trait unix::DeviceIdExt like so:

pub trait DeviceIdExt {
    /// Get the name of the seat this device is associated with
    ///
    /// Some systems can be multi-seat, meaning that there may be more than
    /// one keyboard / pointer, and these should be treated as different users interacting
    /// with the app.
    ///
    /// If this kind of multi-user interaction would be meaningful with your app, this
    /// method allows you to retrieve a seat-unique identifier from this `DeviceId`.
    fn seat(&self) -> &str;
}

While arguably pretty niche, this seat-awareness can be necessary for downstream apps. For example, on wayland, there is one clipboard per seat, and the app should be careful to trigger the copy and paste actions from the appropriate seat.

Thoughts on this design, @francesca64 ?

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 tracing the DeviceId implementations and platform-specific X11 and Wayland integration in winit. Review how device identity is exposed and how multi-seat clipboard behavior affects downstream applications. Done would require an agreed API design and corresponding support for both platforms, but the issue does not define tests or a concrete implementation location.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.