Commit graph

95 commits

Author SHA1 Message Date
Christian Meissl
03aaea2415 anvil: handle dnd icon buffer offset 2024-09-18 14:18:32 +02:00
Christian Meissl
44dd9baa33 anvil: get rid of the cursor image mutex 2024-04-07 09:31:08 +02:00
Victoria Brekenfeld
47a8d5b5e5 anvil: Drop CalloopData 2024-04-02 19:49:40 +02:00
Christian Meissl
4a1b3ea4a1 anvil: update keyboard led state on changes 2024-01-27 19:07:22 +01:00
Ben Widawsky
e7fa4d5ab0 wlcs: Actually git rm the old ffi 2023-11-21 19:13:14 +01:00
Ian Douglas Scott
284ddbd0a8 Use rustix instead of nix
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`.
2023-10-16 19:51:31 -07:00
Ben Widawsky
6501dd56e2 wlcs_anvil: Eradicate FFI
Now that wlcs_anvil no longer provides its own FFI, "ffi_wrappers"
doesn't make sense.

https://github.com/Smithay/smithay/pull/904#discussion_r1115171311
2023-10-11 12:14:20 -07:00
Ben Widawsky
800b430f63 renderer/test: Add feature flag for the test renderer 2023-10-11 12:14:20 -07:00
Ben Widawsky
830fe12e09 renderer: Move DummyRenderer to Smithay
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.
2023-10-11 12:14:20 -07:00
Ben Widawsky
50ef596ba1 wlcs_anvil: Use wlcs-rs crate
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.
2023-10-11 12:14:20 -07:00
Ben Widawsky
6e6536378a wlcs_anvil: Upgrade wayland-sys crate 2023-10-11 12:14:20 -07:00
Kirill Chibisov
16d0ba3877
wayland: add cursor_shape_v1 support 2023-10-02 05:04:01 +04:00
Eivind Gamst
9418366f3a merged master 2023-09-27 12:23:01 +02:00
Elinor Berger
eb44d1721e clippy fixes 2023-09-25 19:03:55 +02:00
Elinor Berger
19e528538e update indexmap, x11rb and criterion 2023-09-24 10:52:55 +02:00
Ian Douglas Scott
3050d3039f Updates for calloop 0.11, using BorrowedFd 2023-09-22 13:16:35 -07:00
Ian Douglas Scott
4c37923cf0 Make frame a seperate method of PointerTarget/PointerGrab
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.
2023-09-21 14:36:57 -07:00
Eivind Gamst
f2ef4d7101 clippy fixes 2023-09-05 17:17:06 +02:00
Ian Douglas Scott
ac511cd93d anvil: Don't store pointer_location, use from PointerHandle
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.
2023-07-24 13:50:51 -07:00
Ian Douglas Scott
f628336ba9 Move some Debug bounds to traits, simplifying a lot of things
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.
2023-06-29 12:12:01 -07:00
Christian Meissl
60bcba03a5 renderer: replace glFinish with SynPoint 2023-06-27 18:26:10 +02:00
Victoria Brekenfeld
eadd43dd85 elements: Allow alpha to be specified in AsRenderElements 2023-05-11 17:59:59 +02:00
Christian Duerr
0c9cc4f9a3
Fix wlcs errors 2023-05-04 22:03:17 +02:00
Victoria Brekenfeld
7196c3e0ae renderer: Format selection for memory formats 2023-04-11 21:02:02 +02:00
Victoria Brekenfeld
d06d129b2a
Merge pull request #963 from cmeissl/feature/improve_render_element
Fix inaccurate renderer nameing
2023-03-26 13:06:47 +02:00
Christian Meissl
814cf45058 renderer: allow to draw a solid color
this extends the Frame with a draw_solid function
that allows to fill parts of the frame with a solid color
2023-03-25 20:03:34 +01:00
Christian Meissl
0190c5b7c9 renderer: rename damage tracking utils
DamageTrackedRenderer renamed to OutputDamageTracker
DamageTracker renamed to DamageBag
DamageTrackerSnapshot renamed to DamageSnapshot
2023-03-25 20:00:44 +01:00
Ian Douglas Scott
87ae8a74f2 Use pointer and length to refer to shm memory, instead of slice
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.
2023-02-24 17:58:32 -08:00
Christian Meissl
5aba2ab8a9
feat: switch from slog to tracing
Switch from slog to tracing
---------

Co-authored-by: Victoria Brekenfeld <github@drakulix.de>
2023-02-22 18:41:12 +01:00
Christian Meissl
10c27090d6 anvil: make use of the new DrmCompositor 2023-02-15 18:48:55 +01:00
Christian Meissl
699b303958 renderer: introduce debug flags
debug flags can be enabled at run-time for a renderer
for now the only supported flag is TINT which will
TINT all rendered textures
2023-02-15 18:40:19 +01:00
Ian Douglas Scott
2e626111af Implement relative pointer protocol
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.
2023-01-23 12:14:29 -08:00
Victoria Brekenfeld
2d9c721068 wlcs_anvil: Update for anvil 2022-12-30 16:33:33 +01:00
Ian Douglas Scott
97fd4ed0b6 Update wayland-rs to beta.14 2022-12-16 09:22:45 -08:00
Christian Meissl
0963d35a36 anvil: add window preview
window preview can be triggered by MOD + SHIFT + W
2022-12-12 13:14:28 +01:00
Victoria Brekenfeld
c3fed37ce3 wlcs_anvil: New renderer_api 2022-11-17 18:03:53 +01:00
Christian Meissl
690fa40c6c anvil: support wp_presentation 2022-11-14 09:43:48 +01:00
Victoria Brekenfeld
0e1d6ca9db deps: Update wayland-rs to 0.30-beta.13 2022-11-04 12:17:33 +01:00
Christian Meissl
c3baca8e3e desktop: limit frame callbacks to primary scan-out output
this limits the frame callbacks to the primary scan-out output
which can be selected by a user provided function
2022-10-28 12:47:42 +02:00
Victoria Brekenfeld
cb146e0693 deps: Update to wayland-rs 0.30-beta.12 2022-10-13 21:17:36 +02:00
Victoria Brekenfeld
079ffaecae deps: Update to wayland-rs 0.30-beta.11 2022-10-13 20:50:16 +02:00
Victoria Brekenfeld
2fc47ff9d4 desktop: Fix handling for output_enter/leave 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.
2022-10-11 17:59:28 +02:00
Victoria Brekenfeld
56d292c4b9 anvil: Fix cursor positioning 2022-10-11 17:59:01 +02:00
Victoria Brekenfeld
09cd2c26e3 wlcs_anvil: Fixups for generic space 2022-10-11 17:59:01 +02:00
Christian Meissl
8779f71c60 flatten renderer modules 2022-10-11 17:58:32 +02:00
Christian Meissl
8073561caf wlcs: fix build 2022-10-11 17:58:08 +02:00
Victoria Brekenfeld
51f6df7d28 fixup rebase 2022-10-11 17:58:08 +02:00
Christian Meissl
1affed03be rename OutputRender to DamageTrackedRenderer
and allow to specify a static output
2022-10-11 17:58:08 +02:00
Christian Meissl
b706991090 fix wlcs compile errors 2022-10-11 17:58:08 +02:00
Christian Meissl
9b8b86ad43 update wayland-rs to 0.30.0-beta.10
* 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)
2022-09-19 11:48:43 +02:00