Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seat identifiers on x11/wayland #795

Open
elinorbgr opened this issue Feb 14, 2019 · 3 comments
Open

Seat identifiers on x11/wayland #795

elinorbgr opened this issue Feb 14, 2019 · 3 comments
Labels
C - needs discussion Direction must be ironed out DS - wayland DS - x11 S - enhancement Wouldn't this be the coolest?

Comments

@elinorbgr
Copy link
Contributor

elinorbgr commented Feb 14, 2019

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 ?

@pickfire
Copy link

pickfire commented Jul 9, 2019

I believe this is the same for X11 which is usually called multi-pointer https://wiki.archlinux.org/index.php/Multi-pointer_X (not to be confused with multi-seat). Quick scanning at the docs, seems like not possible to identify which keyboard active using KeyboardEvent alone.

@notgull
Copy link
Member

notgull commented Aug 13, 2023

Is there a way to get the name of the seat from multi-pointer mode? xtrace seems to indicate that the seat name isn't sent over the wire (at least by default) and the Xinput2 specification doesn't mention seats at all. It seems that master devices take priority here, but the seat name doesn't match up with the real seat (e.g. "seat0").

@kchibisov
Copy link
Member

I'm not sure about X11 here. I know that with Wayland you have seat IDs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - needs discussion Direction must be ironed out DS - wayland DS - x11 S - enhancement Wouldn't this be the coolest?
Development

No branches or pull requests

5 participants