Commit graph

764 commits

Author SHA1 Message Date
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
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
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
Victoria Brekenfeld
2ae38c928a anvil: Add xwayland scale override 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
Ian Douglas Scott
5dc015361c anvil: Use monotonic time instead of 0 for motion events
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-21 13:38:07 -06:00
Christian Meissl
5e3420eb1b anvil: enable support for single pixel buffer 2024-08-20 10:47:03 -06:00
Jeff Peeler
de94e8f59e input: add iso_level5_shift modifier
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: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
2024-07-31 15:44:21 +02:00
Christian Meissl
aa5ea75a24 drm: pick one cursor plane if we have multiple
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: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Blocked by required conditions
Continuous Integration / Documentation on Github Pages (push) Blocked by required conditions
some drivers might offer multiple cursor planes per CRTC.
in this case try to use the first unclaimed plane and try to
keep the same for as long as possible
2024-07-29 14:53:27 +02:00
Christian Meissl
91bea4d1d2 anvil: use ImageReader from image crate...
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: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Blocked by required conditions
Continuous Integration / Documentation on Github Pages (push) Blocked by required conditions
...instead of deprecated image::io::Reader
2024-07-26 21:04:32 +02:00
Christian Meissl
fd194745d6 drm-extras: do not unwrap on scan errors
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: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
this changes scan_connectors to return a result
instead of unwrapping on failing to query the
drm devices resources.
2024-07-08 10:50:24 +02:00
Christian Meissl
253e13eee1 drm: pick one primary plane if we have multiple
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: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Has been cancelled
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Has been cancelled
Continuous Integration / Documentation on Github Pages (push) Has been cancelled
some drivers might offer multiple candidates as the
primary plane for a CRTC. pick one and claim it so that
we do not accidentially select the same plane multiple times.
2024-06-28 12:58:22 +02:00
Victoria Brekenfeld
adefb0f2e3 renderer/gles: Drop shadow buffer 2024-06-26 22:12:01 +02:00
Victoria Brekenfeld
c30f2ec1d4 element: Make MemoryRenderBuffer threadsafe 2024-06-21 16:26:59 +02:00
Victoria Brekenfeld
c4ec3fa75f compositor: Make cached_state access thread-safe 2024-06-21 16:26:59 +02:00
Christian Meissl
26af6a4921 renderer: use the new FormatSet to keep formats in order 2024-06-20 22:40:21 +02:00
Ian Douglas Scott
98b4279bcb Update ash to 0.38.0 2024-06-20 21:17:34 +02:00
Ivan Molodetskikh
68a629d79a Fix new Clippy warnings 2024-06-18 11:01:14 +02:00
Ivan Molodetskikh
fe654453b0 Make input focus store f64 Logical global coords
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: ${{ matrix.job_name }} (buffer, BadBufferTest*, Bad Buffer Test) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (core, SelfTest*:FrameSubmission*, Core tests) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (output, XdgOutputV1Test*, Output tests) (push) Blocked by required conditions
Continuous Integration / WLCS: ${{ matrix.job_name }} (pointer-input, */SurfacePointerMotionTest*:RelativePointer*, Pointer input tests) (push) Blocked by required conditions
Continuous Integration / Documentation on Github Pages (push) Blocked by required conditions
Surface position in global compositor space is not required to be
rounded to logical integers. The compositor is free to put surfaces
wherever. So, do not require an integer-logical position.

Not to be confused with:

* A subsurface can only be at an integer-logical offset from its parent
  surface (for now, at least). However, this is unrelated to the
  subsurface position in the global compositor space.
* A surface buffer is (generally expected to be) at an integer
  *physical* pixel position. However, this is unrelated, and frequently
  isn't, an integer *logical* pixel position.
2024-06-17 14:04:40 +02:00
Christian Meissl
1859d4d28e renderer: forward element opaque regions
this allows to optimize drawing textures in a renderer
2024-06-11 19:48:15 +02:00
Christian Meissl
6fb7f339fd anvil: document supported env variables 2024-06-11 19:48:15 +02:00
Christian Meissl
73aaffc080 anvil: allow to disable direct scan-out 2024-06-11 19:48:15 +02:00
Christian Meissl
30efb435fb anvil: allow to disable color transform 2024-06-11 19:48:15 +02:00
Victoria Brekenfeld
f4327306f9 xwayland: Make hook implementation-detail 2024-06-11 12:57:35 +02:00
PapyElGringo
d6da83baf2
Add the wayland surface to XwaylandShell::surface_associated 2024-06-05 12:20:40 +02:00
kenoss
dfc610a65f style: Use AnvilState<BackendData> everywhere
Before this patch, `AnvilState<BackendData>`,
`AnvilState<Backend: crate::state::Backend>`, and `AnvilState<B>` are
mixed up. This patch uses `AnvilState<BackendData>` for consistency.
2024-06-04 20:19:26 +02:00
Ian Douglas Scott
ba2e43ccf4 Add shape/orientation to TouchHandle and TouchGrab
The event structs were already defined and used in `TouchTarget`, but
there was no way to actually send them.

I would also add backend support for getting these events from libinput,
but apparently that still doesn't exist:
https://gitlab.freedesktop.org/libinput/libinput/-/issues/746.
2024-05-16 14:51:18 +02:00
Christian Meissl
659ceebc97 wayland: return a reference to the stored Dmabuf
this reduces unnecessary clones during scan-out
2024-05-16 10:58:27 +02:00
Christian Meissl
581c750ae9 use Cow<WlSurface> for focus handling
this reduces unnecessary clones significantly
2024-05-16 10:58:27 +02:00
Christian Meissl
f5aeb514a2 inline hints for common operations 2024-05-16 10:58:27 +02:00
Christian Meissl
d4780c59d5 inline hint for otherwise derived operations
the automatic derived implementations would
set the inline hint anyway
2024-05-16 10:58:27 +02:00
Colin Marc
4838c9a74e
Implement the xwayland shell protocol (#1351)
...and use it to associate wl_surfaces to X11 surfaces.

The xwayland shell protocol moves the responsibility of setting the
"xwayland_surface" role on the wl_surface from the x11 side of the connection to
the wayland side. Among other things, this avoids the xwm racing the lifecycle
of the surface.

Since we can check the serial with a commit hook, this also removes the need for
a ugly idle callback in the Xwm, and may allow for better separation of concerns in the
future, for example moving the association state tracking out of Xwm.
2024-05-09 18:34:19 +02:00
Leon Vack
45482a0f69 Avoid unwraping clients from surfaces
Even when handling request for a surface, `surface.client()` may return
`None`. This occurs, for example, if a protocol error is signaled; the surface
remains alive for some time, but `client()` returns `None` immediately after
`post_error` was called.
2024-05-04 10:47:08 +02:00
nferhat
cf2b3076b5 backend/x11: Include window_id inside X11Event::Focus 2024-04-25 22:01:46 +02:00
nferhat
a707afde4d anvil: Fix X11 backend
Just change the match statement from a tuple enum to a struct enum
2024-04-25 22:01:46 +02:00
Colin Marc
8773a74210 Run Xwayland using -displayfd and a pipe
This method, while undocumented, is a lot more robust than an intermediate
shell. It works by passing a pipe to the Xwayland cmdline invocation. When
Xwayland is ready, it writes the display number and a newline to the pipe.

While we're at it, we can remove the hard dependency on Calloop, so that the
Xwayland instance can be used with other event loops.
2024-04-25 22:01:16 +02:00
Kirill Chibisov
40acc58b83 Notify when InputMethod::PopupSurface changes location
Each call to `set_text_input_rectangle` changes the position of the
popup and also will result in popup repositioning, thus notify
users when such request occurs.

The location and text cursor area where separated, since one is used
for the rendering, and the other one is original location.
2024-04-22 10:50:48 +02:00
Ian Douglas Scott
2848e7f9f9 Update drm, gbm, image; xkbcommon/x11rb deps of Anvil
There's also a new `ash` release, but that seems to require some changes
to use. So I left that for now.
2024-04-22 10:47:42 +02:00
Christian Meissl
c9820407ef anvil: make sure the current fullscreen surface is alive 2024-04-21 11:07:37 +02:00
Victoria Brekenfeld
c293ec730f elements/surface: Snapshot render state 2024-04-19 14:11:43 +02:00
Ian Douglas Scott
eea0d9c171 Call *grab::unset in *set_grab, before restoring focus
This fixes an issue I noticed where cancelled drag-and-drop in clients
like Firefox and Nautilus caused a window to ignore pointer events until
losing and regaining focus. It seems calling the `.ungrab` method at the
end of `with_grab` means calling it after pointer focus is restored, and
clients seem not to handle the `wl_pointer.enter` before the drag is
actually over.

Deferring the focus restoration as well is slightly complicated to
implement, and seems problematic when it involves a serial. Maybe there
shouldn't be any input events after the `*set_grab` call but before
returning, but this seems cleaner.

Taking a reference to the handler in `*InterHandle.*set_grab` is a bit
annoying, but easy enough to deal with, and allows this to work more
cleanly. This seems reasonable as long as we don't have a better
solution to the whole `GrabStatus::Borrowed` thing.
2024-04-16 12:00:38 +02:00
Ian Douglas Scott
7cc8d1bb3c Call KeyboardGrab::unset in KeyboardHandle::*_grab
This was already supposed to happen, but I hadn't noticed that these
functions don't delegate to a method of the innter handle, like they do
with touch.

This is a breaking API change, since these functions then need to take
`&mut D`. But this seems reasonable since the equivalents for
pointer/touch already require that, and `&mut D` should be available to
call wherever these are used.
2024-04-16 12:00:38 +02:00
Ian Douglas Scott
033df94071 Add unset method to input grab traits
`unset` is called when a grab is removed with `unset_grab` or replaced
with `set_grab`.

This fixes https://github.com/pop-os/cosmic-comp/issues/403. There are a
couple other grabs in Smithay and cosmic-comp that they run before
unsetting the grab, that may cause issues if the grab is removed without
running it. So this seems useful in general.
2024-04-12 20:42:07 +02:00
Christian Meissl
dbaca428fa renderer: reduce allocations in damage tracking 2024-04-07 11:55:19 +02:00
Christian Meissl
44dd9baa33 anvil: get rid of the cursor image mutex 2024-04-07 09:31:08 +02:00
Christian Meissl
c9f5c792c0 wayland: introduce TabletSeatHandler
this moves the tablet tool image callback to
a separate handler trait
2024-04-07 09:31:08 +02:00
Victoria Brekenfeld
47a8d5b5e5 anvil: Drop CalloopData 2024-04-02 19:49:40 +02:00
Ivan Molodetskikh
bfa56fc54b {an,small}vil: Fix winit scroll values
The usual value for one wheel tick is 15, not 3. This can be verified
with Firefox by scrolling on a TTY backend vs. on the winit backend
(since this particular fallback is used on the winit backend).
2024-04-02 17:58:38 +02:00