Commit graph

7579 commits

Author SHA1 Message Date
Kirill Primak
8f56f7ca43 Assert (almost all) signals have no attached listeners on destroy 2025-01-15 19:53:11 +03:00
Kirill Primak
b03b05d2b3 xdg-dialog: add missing wm destroy signal 2025-01-15 19:51:05 +03:00
Kirill Primak
bcf8e467db xdg-toplevel-icon-v1: add implementation 2025-01-14 18:46:43 +00:00
Simon Ser
061aa1bd15 ext-image-copy-capture-v1: implement PAINT_CURSORS flag
This is unreliable because this is first come, first served: the
first capture stream decides whether or not cursors will be
included. Moreover, if the output lacks hw cursor support, cursors
will always be included. But it's the best we're going to get with
automatic wlr_output sources (and has bug parity with
wlr-screencopy-unstable-v1).
2025-01-14 16:42:12 +01:00
Simon Ser
6bb8bb1cb7 ext-image-capture-source-v1: add start/stop hooks
This allows the source to change its behavior when actively
captured.
2025-01-14 16:42:12 +01:00
Simon Ser
82f9cd5310 backend/headless: accept hardware cursors
When running headless, remoting programs (e.g. VNC servers) might
want to capture outputs without the cursor, and send the cursor
image separately.
2025-01-14 16:42:12 +01:00
Simon Ser
248e837cb3 ext-image-capture-source-v1: add output cursor source 2025-01-14 16:42:12 +01:00
Simon Ser
c0881bdc01 output: require commit after hardware cursor update
Up until now only the DRM backend required an output commit after
updating the cursor. Unify this for all backends, because:

- Screen capture can now catch cursor updates listening for output
  commits
- In the future we want to make the cursor a regular wlr_output_layer,
  which would need an output commit to be updated anyways
2025-01-14 16:42:12 +01:00
Simon Ser
08e14deeca ext-image-capture-source-v1: add output source 2025-01-14 16:42:12 +01:00
Simon Ser
855b3fd607 ext-image-capture-source-v1: add wlr_ext_image_capture_source_v1_set_constraints_from_swapchain() 2025-01-14 16:35:52 +01:00
Simon Ser
c24efad6df ext-image-copy-capture-v1: add wlr_ext_image_copy_capture_frame_v1_copy_buffer() 2025-01-14 16:35:52 +01:00
Simon Ser
4e4155ccbe ext-image-copy-capture-v1: new protocol implementation
Co-authored-by: Andri Yngvason <andri@yngvason.is>
2025-01-14 16:35:50 +01:00
Simon Ser
6712e774d4 ext-image-capture-source-v1: add source pointer cursors 2025-01-14 16:34:11 +01:00
Simon Ser
dadcbf65e6 ext-image-capture-source-v1: add base interface 2025-01-14 16:34:11 +01:00
Kirill Primak
eb85831284 text-input: fix wlr_text_input_manager_v3.text_inputs comment 2025-01-11 21:48:20 +00:00
Kirill Primak
a231bf7f62 backend: drop wl_display refs from docs 2025-01-11 21:36:29 +00:00
Kirill Primak
4a67628cb0 session: drop unused wlr_session.vtnr 2025-01-11 22:42:18 +03:00
llyyr
62ecec6d53 wlr_drag: cleanup icon_destroy listener when destroying icon 2025-01-11 20:20:10 +05:30
Kirill Primak
89000b7df0 backend/session: simplify udev event action matching
This avoids extra strcmp() calls and is easier to read.
2025-01-08 20:45:27 +03:00
Kirill Primak
d5d650f9f6 output: introduce wlr_output_finish() 2025-01-08 16:06:12 +00:00
Kirill Primak
7963ba6a0d buffer: introduce wlr_buffer_finish() 2025-01-08 16:06:12 +00:00
sunzhguy
5eed5d622d session: skip adding duplicate DRM device
Signed-off-by: sunzhguy <sunzhigang1@kylinos.cn>
2025-01-06 10:10:46 +08:00
Kirill Primak
38923826c3 xwayland,render/vulkan: fix some size assertions 2024-12-30 12:47:54 +03:00
liupeng
fa4d8bbad7 render/egl: attribs len could be equal to size
Exts.KHR_display_reference makes assert fail.
2024-12-30 17:34:02 +08:00
Simon Ser
6f6268988b backend: document that buffer_caps/features are mutable 2024-12-25 18:40:05 +00:00
Simon Ser
b908d865b1 backend: replace get_buffer_caps hook with a struct field
Do the same as wlr_renderer: the supported buffer capabilities are
static for the lifetime of the backend.
2024-12-25 18:40:05 +00:00
Simon Ser
9fdffba170 render/allocator: use udmabuf allocator automatically
It makes sense to use udmabuf when the backend wants shm, the
renderer wants DMA-BUFs, and we don't have a DRM FD because we're
running with a software renderer (e.g. llvmpipe or lavapipe).
2024-12-22 21:37:57 +00:00
Simon Ser
cfcf06b8b0 render: add WLR_RENDERER_FORCE_SOFTWARE env var
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3693
2024-12-22 21:37:57 +00:00
Simon Ser
24232e8e98 render/vulkan: accept negative DRM FD to select software rendering 2024-12-22 21:37:57 +00:00
Simon Ser
b4ce0d8b39 render/egl: accept negative DRM FD to select software rendering 2024-12-22 21:37:57 +00:00
Simon Ser
7cf8e80ffe render/allocator: add udmabuf allocator
udmabuf can create a DMA-BUF backed by a memfd. This is useful
when running with a software implementation of GL/Vulkan: the memfd
can be passed to the parent compositor via wl_shm and the DMA-BUF
can be imported via the usual APIs into GL/Vulkan.
2024-12-22 21:37:57 +00:00
Kirill Primak
1c604207c6 seat: don't generate serial 0
0 is reserved to mean "no event has been sent to the client".
2024-12-22 21:33:11 +00:00
Simon Ser
428279a319 build: add Meson wrap manifests for our dependencies
Add Meson wrap manifests for all of our dependencies which can
fallback to a subproject. This makes it easier to build wlroots
on platforms where system packages are outdated. Users can now
opt-in via `meson configure --wrap-mode=default` and Meson will
download and build any missing dependency.

Don't download by default because this can be quite surprising and
undesirable for some users (e.g. if they are just missing some -dev
package).
2024-12-22 21:24:03 +00:00
Kirill Primak
90530d43fe xdg-dialog-v1: add implementation 2024-12-22 20:46:19 +00:00
Consolatis
be555a9a99 backend/drm: make drm_lease implementation follow docs
This ensures compositors get a output_destroy signal when the
lease is granted and a new_output signal when the lease is revoked.
2024-12-21 01:00:12 +01:00
Consolatis
c6de47d415 wlr-foreign-toplevel: version guard fullscreen state 2024-12-21 01:20:53 +03:00
Consolatis
bd3724aa26 wlr-foreign-toplevel: convert to stack backed states array 2024-12-21 01:20:53 +03:00
Consolatis
648c64b7e4 wlr-foreign-toplevel: slight refactor 2024-12-21 01:19:17 +03:00
Consolatis
41e2331843 xwm: add missing NET_WM_STATE states
https://specifications.freedesktop.org/wm-spec/latest/ar01s05.html#id-1.6.8
2024-12-20 21:47:17 +00:00
Simon Ser
776f2c4e4d output: adjust warning when hardware cursors are unsupported
We'd print "cursor texture size exceeds hardware limitations" when
some hardware doesn't support cursors at all. Change the message
to better indicate the cause.
2024-12-20 10:39:42 +00:00
M Stoeckl
b97106ddcb wlr_cursor: use default shape if requested shape missing 2024-12-16 15:34:45 +00:00
Simon Ser
2b4f30dc1d render/gles2: validate shaders at build time
Use glslang to validate GLSL shaders at build time. This is
optional: if glslang is not found, shader validation is skipped.
2024-12-15 13:59:42 +01:00
Consolatis
546c5d000d xwayland: fix xdg->xwayland drag-and-drop
As struct wlr_drag is destroyed on drop and in the process resets
the focus, a xwayland dnd listener would also reset xwm->drag_focus.

This prevents the xcb replies from being processed and also prevents
the transfer if a compositor would not additionally request new focus
in its wlr_drag destroy handler (which is something usually only done
when in a focus-follows-mouse setting).

This patch creates a new xwm->drop_focus pointer which is a copy of
xwm->drag_focus at drop time. The xcb reply handler and transfer
logic now use the new xwm->drop_focus for their authorization checks.
2024-12-11 08:51:10 +01:00
Simon Ser
71943b3b1e data-device: reset focused surface when destroyed
The surface may be destroyed before the struct wlr_seat_client.

Spotted by Consolatis.
2024-12-11 07:15:02 +00:00
Simon Ser
a7ebe7c026 xwayland: remove loop to find drag focus surface
We can just use wlr_xwayland_surface_try_from_wlr_surface() here
instead.
2024-12-07 14:49:26 +01:00
Simon Ser
c7acfe906b xwayland: listen to drag focus destroy signal
The wlr_drag takes care of resetting the focused wlr_surface when
it's destroyed, however we store the wlr_xwayland_surface, which
may be destroyed before.
2024-12-07 14:49:26 +01:00
Simon Ser
9649fbe443 render/vulkan: fix crash on OOM
Closes: https://github.com/swaywm/sway/issues/8485
2024-12-06 14:28:40 +00:00
Tycho Andersen
631e5be0d7 xwayland: don't fail on SIGCHLD
SIGCHLD here isn't fatal: we have other means of notifying that things were
successful or failure, and it causes many compositors to have to do a bunch
of extra work:

https://github.com/qtile/qtile/issues/5101
https://github.com/flacjacket/pywlroots/pull/207#issuecomment-2502680133
https://github.com/djpohly/dwl/pull/212

Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
2024-12-06 14:09:28 +00:00
Consolatis
be3d2b74cf dnd: ensure internal dnd handlers are unlinked on xwm_destroy()
Fixes #3925
2024-11-29 13:42:55 +00:00
Simon Ser
c6dd5e3c2e backend/drm: check buffer format for multi-GPU
Fixes on-screen corruption when displaying a fullscreen client
with an implicit modifier on the secondary GPU.

What happens here:

- Client allocates a buffer with an INVALID modifier on primary GPU.
- Compositor attempts to scan-out this buffer on an output connected
  to secondary GPU.
- Buffer is imported to secondary GPU, and is interpreted as if it had
  the secondary GPU's implicit tiling, even though it has the primary
  GPU's implicit tiling.

We need to forbid cross-device imports with implicit modifiers.
The mgpu_formats list is stripped from any INVALID modifier so
checking that fixes the bug.

Using the mgpu_formats list has an additional benefit: the buffer
is rejected in the test commit if it doesn't have a format supported
by the multi-GPU renderer.

Requires this Mesa bugfix:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31725
2024-11-28 20:27:48 +01:00