wayland-rs icon indicating copy to clipboard operation
wayland-rs copied to clipboard

WIP backend/rs: Using `polling` instead of `kqueue`/`epoll`

Open ids1024 opened this issue 4 months ago • 0 comments

I've had this in my git stash for a while. I think it wasn't working properly, but I may as well put in in a PR as a proof of concept.

Wayland-rs is often used with calloop, so polling is a dependency anyway. It may as well be used here then.

This requires Poller to implement AsFd, so it won't work on platforms that only have poll. https://docs.rs/polling/3.7.3/polling/struct.Poller.html#impl-AsFd-for-Poller mentions that illumos/solaris implement it. But I don't know if it works properly to insert into another poller.

If we want to support platforms that only have something like poll, we'll need a different sort of API, that doesn't require a single fd for polling multiple clients. But libwayland has the same issue, and there may not be much serious use to wayland-rs on platforms that don't support libwayland.

Other than portability, this is a nice cleanup of a bit of platform-specific code, but it's not a huge difference.

ids1024 avatar Oct 18 '24 16:10 ids1024