Commit graph

3563 commits

Author SHA1 Message Date
sodiboo
debffed7ec
add pointer location hint (#1551)
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
* add pointer location hint

* describe why `PointerConstraint::commit()` returns a point

* implement pointer location hint in anvil

* set_location_hint -> set_location

* add note that you should frequently be using `PointerHandle::motion`
2024-09-27 19:27:16 +02:00
Ian Douglas Scott
3b0ecce6c1 Update glow to 0.14
`smithay-egui` also needs to be updated with `egui-glow` 0.29 to match.
2024-09-27 15:49:23 +02:00
Ian Douglas Scott
8e9c7aa0ee
drm-syncobj: Fix handling of wp_linux_drm_syncobj_surface_v1::destroy (#1547)
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-09-25 08:44:00 +02:00
Ian Douglas Scott
950458c2da shm: Use OnceLock instead of static mut
Fixes warning on nightly Rust.
2024-09-25 07:04:28 +02:00
Ian Douglas Scott
66236e3ce9
Add linux-drm-syncobj-v1 protocol (#1356)
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-09-24 10:06:09 +02:00
Christian Meissl
e31fc3380d multigpu: reset texture on surface buffer format change
A surface itself does not have a format, it is implicitly
defined by the currently attached buffer. So whenever
we cache something that depends on that format we
have to clear the cache if the format changes.
2024-09-23 11:42:39 +02:00
may
0cd0895f9b fix deadlock in AtomicDrmDevice
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-09-21 10:29:28 +02:00
may
d5cedeed64 stop deadlocking in raw_latin_sym_or_raw_current_sym 2024-09-20 22:09:49 +02:00
PolyMeilex
2c0076e06f xdg-shell: is_initial_configure_sent getter 2024-09-20 13:21:58 +02:00
PolyMeilex
fa62df741d xdg-shell Fix definition of initial_decoration_configure_sent 2024-09-20 12:41:19 +02:00
Ian Douglas Scott
fdfdaecd36 drm/atomic: Update connector prop mapping in reset_state()
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
On some cards, connectors may have been added dynamically since the
mapping was first created.

Fixes https://github.com/Smithay/smithay/issues/1374.
2024-09-19 17:04:18 +02:00
Ian Douglas Scott
88cdf9bd7d drm/atomic: Put RwLock<PropMapping> in Arc, and share
If this has to be in an `RwLock` anyway, it seems unnecessary to clone
it, and it can just be shared.

(`AtomicDrmDevice` does not use `RwLock` yet, but will if it wants to
update the mapping.)

I don't expect this to cause problems, though maybe it doesn't help much
either. But it makes sense.
2024-09-19 17:04:18 +02:00
Ian Douglas Scott
f4d67cd7ef drc/atomic: Use *_prop_handle() instead of duplicating same logic 2024-09-19 17:04:18 +02:00
Ian Douglas Scott
4e9d253f8d drm/atomic: Make *_prop_handle() methods of PropMapping 2024-09-19 17:04:18 +02:00
Ian Douglas Scott
a35fd01ac4 drm/atomic: Make Mapping a struct with named fields
Even though it's type safe, using tuple indexes to access the fields
seems unnecessarily confusing. It's generally better to have a named
type.
2024-09-19 17:04:18 +02:00
Ian Douglas Scott
65ff32da23
Make SealedFile helper public (#1539)
* Make `SealedFile` public

This may be useful for other protocols compositors may want to implement
that require sealed files.

Given this is a simple API and Smithay doesn't have any particular API
stability guarantees, making it public seems reasonable enough.

* Accept `&CStr` arguments instead of `CString`

This doesn't currently do anything that requires an owned type.
2024-09-19 00:25:00 +02:00
Ian Douglas Scott
08d31e17ea Use impl Iterator instead of Box<dyn
No longer needed now that this isn't part of a trait.
2024-09-18 19:51:10 +02:00
Ian Douglas Scott
3293482ca4 keyboard: Don't hold lock in callback to input/input_intercept
Holding a mutex during the callback causes a deadlock if something
invoked by the callback tries to call a `KeyboardHandle` method. Or if
the callback locks another mutex, which in another thread may be held
while the keyboard mutex is locked.

This is bad, and the mutex here should generally be a hidden
implementation detail. Or if absolutely necessarily this restriction
should be documented.

This requirements to make this work aren't ideal, but probably aren't a
problem. We have to create a copy of `mods_state` on the stack. `Xkb`
needs to be store in an `Arc<Mutex<_>>` for finer-grained locking. And
`modified_syms()` and `raw_syms()` need to return `Vec`s instead of
slices.

The `Vec`s could be changed back to slices in the type signatures if we
used `OnceCell` to cache the return value, but that probably doesn't
matter that much in practice.
2024-09-18 19:51:10 +02:00
Ian Douglas Scott
c20868d4ce keyboard: Reuse xkb::Context instead of creating new one 2024-09-18 19:51:10 +02:00
Ian Douglas Scott
2950e471f3 keyboard: Move methods of XkbContextHandler to Xkb struct
Using composition like this seems like a cleaner solution than a trait
with default implementations.
2024-09-18 19:51:10 +02:00
Ian Douglas Scott
9f0b021bf8 keyboard: Combine xkb types in one struct
It's cleaner to make the `unsafe impl Send` more fine-grained, and this
should help with some future changes.

Since `XkbContextHandler` is public, this fixes a soundness issue in the
public API, since it was possible with a safe call to get an
`xkb::Keymap` and `xkb::State`, and clone those. Potentially violating
the safety assumption of the `Send` implementation.
2024-09-18 19:51:10 +02:00
Victoria Brekenfeld
cd322f37e2 ext_foreign_toplevel_list: Allow to retrieve resources 2024-09-18 19:48:47 +02:00
Ian Douglas Scott
d5693af650 x11: Ignore key repetition
This backend should avoid producing key press events for key repeat,
the libinput backend.

You can see in `wev` that this prevents repeated key press events on
held keys that don't happen with libinput.
2024-09-18 19:24:55 +02:00
Ian Douglas Scott
dc5f01516b x11: Use xinput2 protocol
If we require dri3 and present, it should be fair to assume xinput2 as
well. This will be needed if we want to add touch and gesture events,
etc.
2024-09-18 19:24:55 +02:00
Christian Meissl
b29ff8fdbf anvil: handle toplevel buffer offset 2024-09-18 14:18:32 +02:00
Christian Meissl
03aaea2415 anvil: handle dnd icon buffer offset 2024-09-18 14:18:32 +02:00
Christian Meissl
86e8b80eeb anvil: handle cursor image offset 2024-09-18 14:18:32 +02:00
Christian Meissl
b059519a4e backend: remove implicit buffer offset handling
the buffer offset should be handled in a role specific way.
adding the offset to the surface view to offset the surface
is wrong.
2024-09-18 14:18:32 +02:00
Paraworker
caa29100ba Replace lazy_static with once_cell::sync::Lazy 2024-09-18 13:30:33 +02:00
PolyMeilex
fe643bd16c Drop scan_fmt dependency 2024-09-18 13:06:24 +02:00
Ian Douglas Scott
566e176b44 Use Keycode type consistently for representing keycode
It seems good to use a dedicated type for keycodes, particularly given
there's two conventions for keycodes, offset by 8. So there's ambiguity
about what the numberic value of the keycode actually represents.

We might prefer to use the Wayland value rather than the X11 version
like `xkeysym::KeyCode` uses. But it would complicate things to have two
different keycode types, and the code that calls `kbd.key` already is
converting from `Keycode`.
2024-09-18 13:02:57 +02:00
Ian Douglas Scott
1259a69992 Enable IN_FENCE_FD on Nvidia 560 driver
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-09-13 17:25:52 +02:00
may
f364c73cae specify ExactSizeIterator for Space::elements()
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-09-10 21:17:05 +02:00
Bartłomiej Maryńczak
85268cde71
wayland.xdg_toplevel_icon: Initial implementation (#1512)
* wayland.xdg_toplevel_icon: Initial implementation
* wayland.shm: Introduce destruction hooks
2024-09-10 19:31:34 +02:00
Christian Meissl
ba75638167 drm-extras: replace edid-rs with libdisplay-info
Some checks are pending
Continuous Integration / format (push) Waiting to run
Continuous Integration / clippy-check (push) Waiting to run
Continuous Integration / check-msrv (push) Blocked by required conditions
Continuous Integration / check-minimal (push) Blocked by required conditions
Continuous Integration / smithay-check-features (push) Waiting to run
Continuous Integration / smithay-tests (push) Blocked by required conditions
Continuous Integration / smallvil-check (push) Blocked by required conditions
Continuous Integration / anvil-check-features (push) Blocked by required conditions
Continuous Integration / WLCS: Bad Buffer Test (push) Blocked by required conditions
Continuous Integration / WLCS: Core tests (push) Blocked by required conditions
Continuous Integration / WLCS: Output tests (push) Blocked by required conditions
Continuous Integration / WLCS: Pointer input tests (push) Blocked by required conditions
Continuous Integration / Documentation on Github Pages (push) Blocked by required conditions
2024-09-10 15:01:26 +02:00
Ian Douglas Scott
13164854de drm: Update for NetBSD 2024-09-10 13:59:57 +02:00
Ian Douglas Scott
a15d8e50c6 winit, x11: Fix scroll direction
Testing with this, horizontal and vertical scroll now seems to work
expected on both winit and X11.

Fixes https://github.com/Smithay/smithay/issues/1524.
2024-09-10 13:58:38 +02:00
Ian Douglas Scott
d2d7454763 xwm: Add disconnected method when we lose connection to X server
The compositor can then destroy the `X11Wm`. Which is needed for the
`strong_count` of the `Arc<RustConnection>` to drop to `0`.
2024-09-10 13:57:25 +02:00
Ian Douglas Scott
9c5e5b5b4f xwayland: Collect return status of Xwayland and print error
Spawning a thread isn't ideal, but really isn't a problem. There's not
an easy portable way to wait for a subprocess in a non-blocking way.

This ensures the PID is reaped, and logs something that may be useful.
2024-09-10 13:57:25 +02:00
Ian Douglas Scott
2746573522 xwayland: Log an error when Xwayland disconnects with protocol error 2024-09-10 13:57:25 +02:00
Ian Douglas Scott
3070a0954e ci: Fix documentation build
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-09-06 19:31:39 +02:00
Christian Duerr
656178be0a Add accessor for FormatSet's underlying storage
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
This gives read-only access to the underlying storage of `FormatSet`, to
make it simpler for consumers to combine formats without having to
reallocate.
2024-09-02 23:36:41 +02:00
Victoria Brekenfeld
65c4abf4cb Revert "xwm: Don't reparent on unmap"
Some checks failed
Continuous Integration / format (push) Has been cancelled
Continuous Integration / clippy-check (push) Has been cancelled
Continuous Integration / smithay-check-features (push) Has been cancelled
Continuous Integration / check-msrv (push) Has been cancelled
Continuous Integration / check-minimal (push) Has been cancelled
Continuous Integration / smithay-tests (push) Has been cancelled
Continuous Integration / smallvil-check (push) Has been cancelled
Continuous Integration / anvil-check-features (push) Has been cancelled
Continuous Integration / WLCS: Bad Buffer Test (push) Has been cancelled
Continuous Integration / WLCS: Core tests (push) Has been cancelled
Continuous Integration / WLCS: Output tests (push) Has been cancelled
Continuous Integration / WLCS: Pointer input tests (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
This reverts commit c6aab182a3.
2024-08-30 17:57:06 +02:00
Victoria Brekenfeld
bc7f5c8c0f xwm: Add XSETTINGS management
Some checks are pending
Continuous Integration / format (push) Waiting to run
Continuous Integration / clippy-check (push) Waiting to run
Continuous Integration / check-msrv (push) Blocked by required conditions
Continuous Integration / check-minimal (push) Blocked by required conditions
Continuous Integration / smithay-check-features (push) Waiting to run
Continuous Integration / smithay-tests (push) Blocked by required conditions
Continuous Integration / smallvil-check (push) Blocked by required conditions
Continuous Integration / anvil-check-features (push) Blocked by required conditions
Continuous Integration / WLCS: Bad Buffer Test (push) Blocked by required conditions
Continuous Integration / WLCS: Core tests (push) Blocked by required conditions
Continuous Integration / WLCS: Output tests (push) Blocked by required conditions
Continuous Integration / WLCS: Pointer input tests (push) Blocked by required conditions
Continuous Integration / Documentation on Github Pages (push) Blocked by required conditions
2024-08-29 19:53:27 +02:00
Victoria Brekenfeld
2ae38c928a anvil: Add xwayland scale override 2024-08-29 19:53:27 +02:00
Victoria Brekenfeld
d639474dee renderer/utils: Use surface_view to automatically handle client_scale 2024-08-29 19:53:27 +02:00
Victoria Brekenfeld
738bc89a8d xwm: Convert X11 coordinates if client_scale is in use 2024-08-29 19:53:27 +02:00
Victoria Brekenfeld
9a7afcf7b1 wayland: Use new client_scale and Client-space in various protocols 2024-08-29 19:53:27 +02:00
Victoria Brekenfeld
e9b02ede20 compositor: Add client_scale to client state 2024-08-29 19:53:27 +02:00
Victoria Brekenfeld
81ef4d5ddd geometry: Add new private Client coordinate space 2024-08-29 19:53:27 +02:00