Skip to content

Ei protocol support using reis - #2051

Merged
Drakulix merged 7 commits into
Smithay:masterfrom
hojjatabdollahi:hojjat/reis
Jun 16, 2026
Merged

Ei protocol support using reis#2051
Drakulix merged 7 commits into
Smithay:masterfrom
hojjatabdollahi:hojjat/reis

Conversation

@hojjatabdollahi

@hojjatabdollahi hojjatabdollahi commented Jun 5, 2026

Copy link
Copy Markdown
Contributor

Description

based on #1388

It also pulls in the changes in ids1024/reis#12

Checklist

@hojjatabdollahi hojjatabdollahi changed the title Hojjat/reis Ei protocol support using reis Jun 5, 2026
Comment thread src/backend/libei/input.rs Outdated
@hojjatabdollahi
hojjatabdollahi force-pushed the hojjat/reis branch 3 times, most recently from 71ae5fa to 874c288 Compare June 10, 2026 22:22
@ids1024

ids1024 commented Jun 15, 2026

Copy link
Copy Markdown
Member

ei_text support is merged in reis now, and should work, though the code here still needs support for it (or there's not that much need to be pointing at that branch instead of the current release). There's also a DeviceClosed now that should work with just:

EisRequest::DeviceClosed(event) => Some(InputEvent::DeviceRemoved { device: event.device })

reis should be released with this soon.

@ids1024

ids1024 commented Jun 16, 2026

Copy link
Copy Markdown
Member

I've released reis 0.7.0.

It would be good to get this merged. If anything needs to be changed in the future, smithay doesn't have a particularly stable API. The main blocker here was coming up with a decent API, which I think the API I added here in January is pretty solid. The cosmic-comp support needn't block this since we have support in anvil.

The WIP/TODO/XXX commits can be squashed into my first commit here. For ei_text support, we'll need add_text() etc. like we have for other types of input. Though we don't necessarily need that to merge this.

ids1024 and others added 7 commits June 15, 2026 22:40
The EI protocol is needed for the xdg-desktop-portal `RemoteDesktop`
portal to emulate input devices, as well as by the `InputCapture` portal
for Synergy-like uses (input-leap supports Wayland with this portal).

This exposes a relatively simple API for a compositor to create EI seats
and devices, mirroring the `Seat` API. It also provides an
`InputBackend`
that converts emulated input to Smithay input events.

Receiver contexts for the `InputCapture` portal are also a bit more
complicated to implement. Those involve capturing input once the cursor
crosses outside the display. That isn't implemented at all here yet.

We may want to change things in the future to accommodate receiver
contexts, etc. But this API is fairly minimal to use, so future breaking
changes shouldn't be too challenging for a compositor to adapt to.
This seems a bit awkward to support on other backends given how Anvil
uses `process_input_event_windowed` there...

This implementation creates a socket file and sets `LIBEI_SOCKET` to
allow sending emulated input events to Anvil.
@hojjatabdollahi
hojjatabdollahi marked this pull request as ready for review June 16, 2026 04:44
@ids1024

ids1024 commented Jun 16, 2026

Copy link
Copy Markdown
Member

1d235ca seems out of place here? XWayland::spawn doesn't really have anything to do with this.

@hojjatabdollahi

Copy link
Copy Markdown
Contributor Author

It's needed for enabling ei_portal in xwayland. Do you suggest I open a separate PR for that?

@ids1024

ids1024 commented Jun 16, 2026

Copy link
Copy Markdown
Member

Ah, right. I guess that's reasonable then.

@ids1024 ids1024 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will need another review from someone other than me, but I think it should all be good to merge. We can add anything like ei_text later. It's nice to eventually merge things instead of repeatedly re-basing and updating the same commits.

@Drakulix Drakulix left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM as well. Thanks!

@Drakulix
Drakulix merged commit 71a5d9e into Smithay:master Jun 16, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants