Rustix doesn't provide `sigaction` since this requires libc and can't be
done correctly through just direct system calls. But just calling `libc`
isn't particularly worse than nix here.
We no longer need to define `major`/`minor` for FreeBSD since `libc` has
those in its latest release. I see an issue with DRM devices preventing
me from starting Anvil on my FreeBSD 13.2 install, but it seems to be
an issue on `master` unreleated to this change.
The `nix` dependency is still used for matching errors from the `drm`
crate... that probably should be changed in `drm`. It would be best to
avoid a public dependency on either in `drm`.
DummyRenderer is useful for any compositor that wants to implement
support for WLCS. The diff has small modifications but is primarily:
`git mv wlcs_anvil/src/renderer.rs src/backend/renderer/dummy.rs`
To keep the patch as close as possible to just a move operation, further
fixes will be done separately.
This replaces the WLCS integration with an external crate that provides
the same functionality. Wlcs-rs exists to provide multiple compositors
with support for WLCS.
Input handling in compositors will have to emit this appropriatly. But
then other methods don't have to map perfectly to frames.
Meant to address https://github.com/Smithay/smithay/issues/1126.
If the pointer location is tracked within Smithay, it seems bad for to
have a separate copy of it; assuming we never want them to get out of
sync. And it seems in a couple cases `pointer_location` was being
changed without emitting pointer events and changing the value within
Smithay.
The `PointerHandle` is stored in state, so it isn't necessary to call
`get_pointer` and `unwrap` everywhere. Which seems good to avoid anyway.
In the few cases where `pointer_location` was changed without emitting
pointer motion events (like with tablets) this now emits pointer events
as well.
In general, I don't think there's any reason to use types that don't
implement `Debug` here? And a crate can always implement `Debug` in some
way for its own types, even if it isn't derivable.
With this, a lot of `Debug` implementations can just be derived, and
code can assume these types are printable without additional bounds. The
latter should generally be an API improvement.
Creating a slice into shared memory is problematic, since this is
considered undefined behavior if the client mutates the memory. This is
especially a problem since it was creating a slice for the whole pool,
as even a correctly behaving client may mutate another buffer in the
same pool.
We don't want to trust clients not to mutate buffers for soundness, even
if it's not obvious what bugs or exploits this could result in. It's
also quite unnecessary if all we do is convert the slice back to a
pointer and pass it to OpenGL.
Memory access that could result in `SIGBUS` is probably also problematic
in access from safe Rust code that expects all memory accesses to
succeed.
This simply replaces the slice with a pointer and length, which for the
most part (with the current renderer implementation) means we're not
converting to a slice just to convert it back to a pointer again.
Add helper for the relative pointer protocol, and a way to send relative
pointer events to clients. This also exposes unaccelerated vectors and
microsecond timestamps in pointer events from the libinput backend.
Enables `wlcs` relative pointer test, though what `wlcs` currently
handles seems to be limited at this point.
Adds relative pointer support for Anvil, exposing the global only on the
`udev` backend so clients won't use the protocol but get no events.
- SurfaceTree is not really mapped by anything, remove SpaceElement impl
and just provide AsRenderElements (TODO: Implement it directly for
WlSurace?)
- LayerSurface is not mapped, by belongs to an Output, so also remove
its SpaceElement implementation
- Windows consist of multiple surfaces and can be on multiple outputs
simutaniously. This means some surfaces might not be inside one
outputs bounds, we thus need to provide `output_enter` and `refresh`
with positioning information to allow for multiplexing this call
correctly
- Additionally surfaces can be destroyed and created at any point, so
refresh needs to recalculate outputs.
* adds io_lifetimes to make use of Owned/BorrwoedFd on rust < 1.63
* liveness tracking for external objects like EGL buffers (fixes
occasional segfaults when a egl client disconnects that does not
use dmabuf)