Commit graph

7579 commits

Author SHA1 Message Date
Kenny Levinsen
aef4de2ced wlr-foreign-toplevel-management-v1: Simply leave and destroy code
We send the output_leave event and destroy a toplevel_output both if our
output_leave listener is called, or if the underlying wlr_output is
destroyed.

We somewhat clumsily reused the output_leave listener, which meant that
even though we had the toplevel output, we went out of our way to let
the output_leave handler find said toplevel_output again.

Simplify both pathways by adding a toplevel_output_leave function.
Should have no functional changes.
2025-05-06 00:45:09 +02:00
Simon Ser
e57dd9c5ef render/vulkan: check binary semaphore in vulkan_sync_render_buffer()
Ensure the binary semaphore is available when we need it.
2025-05-05 22:17:11 +02:00
Simon Ser
d4e4c9f64b render/vulkan: create binary semaphore when signal timeline is supplied
We were only creating the binary semaphore when implicit sync
interop was available. We also use the binary semaphore when
explicit sync is enabled.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3973
2025-05-05 22:17:04 +02:00
YaoBing Xiao
22db307e4c backend/drm: assign plane_id from function parameter instead of drm_plane 2025-04-30 17:10:45 +08:00
Simon Ser
156d47c866 build: bump version to 0.19.0-rc3 2025-04-27 22:48:44 +02:00
Isaac Freund
80f33cd350 presentation-time: make version a uint32_t
This is consistent with wlr_xdg_shell_create(), wlr_shm_create(),
wlr_layer_shell_create(), etc.
2025-04-27 20:42:57 +00:00
Isaac Freund
7dd8fdf76c tablet-v2: cleanup focused surface on tool destroy
Currently the surface_destroy listener may not get removed if
destroy_tablet_tool_v2() is called while the tool is in proximity to a
surface.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3969
Reported-by: Hooman Ise
2025-04-27 16:57:50 +00:00
YaoBing Xiao
648aee65ad backend/drm: rename conn_name to conn_type_name for clarity 2025-04-27 15:33:36 +00:00
tokyo4j
86976870bd wlr_keyboard_group: fix leak of wlr_keyboard_group->keys
If the underlying wlr_keyboard emits duplicated key-presses,
wlr_keyboard_group->keys might not be empty even after calling
wlr_keyboard_group_remove_keyboard() for all of the keyboards.
2025-04-25 03:23:26 +09:00
tokyo4j
bd8454d3bc Revert "wlr_keyboard: don't emit key event for duplicated keycodes"
This reverts commit 86eaa44a3a.

That commit caused a regression for IME users in many compositors:
when a input_method is activated while a key is pressed, and a virtual
keyboard is created by IME, the following key-release event via the
virtual keyboard is missed since the key in the virtual keyboard haven't
been pressed. For example, pressing and releasing Ctrl+F in Firefox with
fcitx5 running triggered repeated keys (ffffff...) in the opened input
box.
2025-04-25 03:23:21 +09:00
Isaac Freund
e9450a9947
xdg-activation: make wl_global public
This is currently inconsistent with everything else in wlroots.
2025-04-24 13:20:11 +02:00
Simon Ser
78aaaaf7b6 Revert "xwayland: Reset signal mask and handlers before exec"
This reverts commit 954dba3968.

Motivations:

- This only resets some state, but other global state such as other
  signal handlers, process limits (e.g. NOFILE) or system-specific
  settings are left as-is. The chunk of state which does get reset
  is opinionated.
- Compositors have other ways to do this, e.g. with pthread_atfork()
  or with empty signal handler callbacks.
2025-04-20 21:12:33 +02:00
Simon Ser
b9d3ee9a2c build: bump version to 0.19.0-rc2 2025-04-20 13:21:10 +02:00
Kirill Primak
7bf669fb5c xdg-surface: fix geom for surfaces that don't set it explicitly
If a surface which relies on the default window geometry (e.g. wlroots'
Wayland backend output) gets resized, the geometry doesn't get updated.
This commit fixes that. Additionally, the fallback is the explicitly
set window geometry now, not the extents; this works better for
Chromium.
2025-04-19 16:42:56 +03:00
M Stoeckl
8dab5f838d color-management-v1: implement surface_feedback_v1::get_preferred_parametric 2025-04-19 08:20:37 -04:00
YaoBing Xiao
3ad4374a54 backend/drm: add DRM object and property IDs to error 2025-04-18 17:36:05 +08:00
Kirill Primak
ed2406621a xdg-surface: don't disconnect clients for bad effective geom yet
Preferably, the geometry computation would've been done at the client
commit time, but this requires correct subsurface state management which
we don't have at the moment. The next best solution, which is computing
the geometry on server commit time, doesn't currently have a way to
prevent user commit handlers from firing, meaning that compositors might
get an invalid surface state. Additionally, Chromium and gtk-layer-shell
turned out to violate the protocol in this regard, so client
disconnection leads to really bad UX.

As such, complain via a log message instead, and ignore invalid
geometry, falling back to the bounding rectangle.
2025-04-17 15:17:31 +03:00
Philipp Kaeser
f8c639f19a output_layout: Fixes docstring for wlr_output_layout_add[_auto]. 2025-04-16 19:57:33 +02:00
Kirill Primak
5fd43add1c Fix/cleanup includes a bit 2025-04-15 20:13:29 +03:00
Kenny Levinsen
4277d8cfdc scene: Fix scanout log to respect SCANOUT_SUCCESS
scene_entry_try_direct_scanout returns a tristate value, but the log
message was not updated to account for this.

Compare whether or not the state is specifically SCANOUT_SUCCESS for
logging purposes.

Fixes: c450991c4b
2025-04-14 20:36:09 +02:00
Kenny Levinsen
867960d6f4 compositor: Clean up surface current_outputs last
During surface resource cleanup, several signals will be emitted. If any
of these end up calling wlr_surface_send_enter, a new output could be
added to the current_outputs list. This would result in a leaked
surface_output and a dangling wlr_surface pointer.

Clean up current_outputs last.

References: https://github.com/swaywm/sway/issues/8650
2025-04-14 12:46:02 +02:00
Yixue Wang
d7527778bb wlr_client_buffer: add get_shm implementation 2025-04-13 20:48:59 +00:00
Kirill Primak
5dc73937ff xdg-surface: ensure that the effective geom is not empty
Fixes: 5c98d1a04a
2025-04-13 13:26:26 +03:00
Simon Ser
7161bcfabc build: bump version to 0.19.0-rc1 2025-04-12 22:50:55 +02:00
Olivier Tilloy
1e7baefe96 seat/keyboard: optimize wlr_seat_set_keyboard to send the keymap only if it has changed 2025-04-11 16:56:36 +02:00
Kirill Primak
9c9bf2efee xdg-system-bell-v1: set proper global/resource user data
See https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3963.
2025-04-11 14:04:23 +00:00
David Turner
0bf0c55ad2 scene: Move single-pixel buffer things to scene_buffer
Move single-pixel buffer status cache from wlr_scene_surface to
wlr_scene_buffer, it makes more sense there and means the optimisations
will still work if wlr_scene_buffer is used without wlr_scene_surface.
2025-04-11 14:01:35 +00:00
Kenny Levinsen
c450991c4b wlr_scene: Debounce dmabuf feedback on scanout
Direct scanout can be enabled and disabled on a frame-by-frame basis,
and so we could end up sending different feedback to a surface on every
other frame. Reacting to new feedback is expensive, as the client may
need to reallocate their swapchain.

Debounce the state change a number of frames, for now set to 30, to
avoid immediate reaction to scanout (or composition) that only lasts a
few frames.

A timer could be used instead, but it did not seem worth the complexity.
What just want to know that the state has been stable across a
reasonable number of samples, and a counter seems sufficient for that.
2025-04-10 12:44:03 +00:00
David Turner
792bee9657 scene: Optimize rendering of single-pixel buffers
The single-pixel buffer protocol is used to allow wayland clients to
easily draw solid-color rectangles by presenting a 1x1-pixel buffer and
scaling it to the desired size.  This patch improves how these buffers
are then handled in the scene-tree renderer.

We already ignore opaque black rectangles at the very bottom (and
anything under them) because we assume we'll be rendering on a black
background.  This patch detects black opaque single-pixel buffers and
handles them in the same way as black opaque rectangles.  It also
renders single-pixel buffers as rectangles rather than buffers because
this is probably more efficient in the underlying renderer.

In wlr_scene_surface we cache whether the attached buffer is a
single-pixel buffer.  This is done because the
wlr_single_pixel_buffer_v1 will be destroyed after texture upload, after
which it becomes much more annoying to check if the buffer is a
single-pixel buffer.
2025-04-07 13:28:51 +01:00
David Turner
5563d23b81 single-pixel-buffer: Add try_from_buffer() function
Add wlr_single_pixel_buffer_v1_try_from_buffer() and move `struct
wlr_single_pixel_buffer_v1` to wlr_buffer.h. This allows other code to
find out if a wlr_buffer is a single-pixel buffer and, if so, find out
what color it is.
2025-04-07 13:25:42 +01:00
Simon Ser
709fc8fd8e ext-data-control-v1: fix types in wl_list/wl_signal comments
These refer to the wlr protocol types.
2025-04-06 10:09:54 +00:00
Kirill Primak
9c51424f8d ext-data-control: add missing listener list assertion 2025-04-06 10:13:40 +03:00
Kirill Primak
84fc6aaf5a Drop region.h
This header has been deprecated a while ago.
2025-04-01 15:42:39 +03:00
Kirill Primak
582f487b22 meson: add a missing src file 2025-04-01 11:41:56 +00:00
YaoBing Xiao
5f65b1194c ext_image_capture_source_v1: remove unused wlr_renderer include 2025-03-31 17:42:00 +08:00
Simon Ser
fa6cd856e3 color-management-v1: add setter for surface feedback 2025-03-30 16:31:44 +02:00
Simon Ser
95c85af87c color-management-v1: add support for mastering display metadata 2025-03-30 16:31:44 +02:00
Simon Ser
dcf38e3ea9 color-management-v1: add wlr_surface_get_image_description_v1_data() 2025-03-30 16:31:44 +02:00
Simon Ser
ab4ed32c06 color-management-v1: add support for parametric image desc creator 2025-03-30 16:31:37 +02:00
Simon Ser
6d4737a7f6 color-management-v1: add struct wlr_image_description_v1 2025-03-30 16:31:27 +02:00
Simon Ser
0ab3c1d060 color-management-v1: new protocol
This implements the bare minimum to expose the protocol interfaces.

References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/14
2025-03-30 16:31:17 +02:00
Simon Ser
10b8880fc7 render/color: add wlr_color_transfer_function_get_default_luminance() 2025-03-30 16:21:26 +02:00
Simon Ser
50537e2e6f render/color: introduce enum wlr_color_transfer_function 2025-03-30 16:21:26 +02:00
Simon Ser
e11012a024 render/color: introduce wlr_color_primaries_from_named() 2025-03-30 16:21:26 +02:00
Simon Ser
7d076d0bc9 render/color: introduce wlr_color_named_primaries 2025-03-30 16:21:26 +02:00
Simon Ser
156201fe71 render/color: add wlr_color_primaries_to_xyz() 2025-03-30 16:21:26 +02:00
Simon Ser
d8ad4809fc render/color: include public header from private one 2025-03-30 16:21:26 +02:00
Simon Ser
420b60f203 util/matrix: add matrix_invert() 2025-03-30 16:21:26 +02:00
Kirill Primak
9dbf5b9f6b fullscreen-shell: remove
The protocol implementation has been marked as deprecated in the
previous release.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3846
2025-03-30 01:15:09 +03:00
Simon Ser
99da6ccc87 backend/drm: pass DRM_MODE_ATOMIC_NONBLOCK for test commits
The kernel performs some additional checks when
DRM_MODE_ATOMIC_NONBLOCK is supplied: it requires that none of the
planes are still busy with a previous page-flip.

Pass the flag during test-only commits so that we don't end up
performing a commit which will fail.
2025-03-24 12:45:47 +00:00