Commit graph

3550 commits

Author SHA1 Message Date
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
Victoria Brekenfeld
dd23282222 input/kbd: Don't send repeat_info for lower wl_keyboard versions 2024-08-29 18:47:20 +02:00
PolyMeilex
05cb87fc6a Fix ZwpTabletV2 reference cycles
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-28 17:30:00 +02:00
PolyMeilex
c01d567b0a Fix ZwpTabletToolV2 reference cycles 2024-08-28 17:30:00 +02:00
PolyMeilex
356e8ac0b8 Fix ZwpTabletSeatV2 reference cycles 2024-08-28 17:30:00 +02:00
PolyMeilex
eb72806aa2 Fix ZxdgOutputV1 reference cycle 2024-08-28 17:29:15 +02:00
PolyMeilex
d476d90eb2 Fix WlOutput reference cycle 2024-08-28 17:29:15 +02:00
PolyMeilex
298bef358d Fix WlTouch reference cycles
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-27 19:42:43 +02:00
PolyMeilex
b644643c25 Fix WlPointer reference cycles 2024-08-27 19:42:43 +02:00
PolyMeilex
077205065e Fix WlKeyboard reference cycles 2024-08-27 19:42:43 +02:00
Bartłomiej Maryńczak
ac7c22af58
wayland.foreign_toplevel_list: Initial implementation (#1513)
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-27 11:03:35 +02:00
Christian Meissl
03215f05a7 drm: reduce cursor plane size when possible
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
with the new SIZE_HINTS property it might be
possible to select a smaller buffer for the cursor plane
resulting in less power usage for the cursor.
2024-08-26 13:21:50 +02:00
Christian Meissl
f852e32eee drm: include plane size hints if available
this adds support for the new SIZE_HINTS drm plane
property. the property might contain a list of hints
in the order of preference. currently this is only used
for cursor planes.
2024-08-26 13:21:50 +02:00
Ivan Molodetskikh
13333624f8 layer: Take popup geometry loc into account
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
Fixes offset cursor position.
2024-08-24 00:19:20 +02:00