Commit graph

2807 commits

Author SHA1 Message Date
Consolatis
c39b3ce7a3 transient_seat: initialize seat destroy listener
This fixes a `wl_list_remove()` from an uninitialized listener
when using `wlr_transient_seat_v1_deny()` in a `create_seat`
handler.
2025-07-10 19:52:45 +02:00
Simon Ser
f4327f52cf xdg-toplevel-tag-v1: new protocol
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/238
2025-07-07 09:10:37 +00:00
Félix Poisot
31b78a4f3a scene: fix output transfer functions
fixes: bf40f396b
2025-07-03 12:29:27 +00:00
David Turner
58c3680d96 scene: Block damage on single-pixel buffer textures
We cache whether buffers are single-pixel buffers (and if so what color
they are) to allow rendering optimizations.  But this breaks if the
client changes out the single-pixel buffer for one with a different
color, because this updates the texture in-place instead of actually
changing the buffer.

We can fix this by blocking in-place texture updates for single pixel
buffers.

Original bug: https://codeberg.org/ifreund/waylock/issues/121
See also: !5092
2025-07-01 11:38:56 +01:00
Simon Ser
bf40f396bf scene: grab image description from output state
Alternative to https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/5089
2025-06-26 09:56:12 +00:00
Simon Ser
2498036e67 output: add output_pending_image_description() 2025-06-26 09:56:12 +00:00
Simon Ser
e76f8ac2b3 output: add wlr_output.image_description
Stores the current image description.
2025-06-26 09:56:12 +00:00
Simon Ser
98af337175 output: shorten output enabled checks
Use a more concise loop instead of repeated logic.

No behavior change.
2025-06-20 19:02:54 +02:00
Simon Ser
0c272a3842 scene: add support for color-management-v1 primaries 2025-06-18 19:37:55 +00:00
Simon Ser
071773cb27 scene: add primaries support to wlr_scene_buffer 2025-06-18 19:37:55 +00:00
Simon Ser
7a1161438c scene: add support for color-management-v1 transfer functions 2025-06-18 19:37:55 +00:00
Simon Ser
4efec11721 scene: add transfer function support for wlr_scene_buffer 2025-06-18 19:37:55 +00:00
Simon Ser
c8d94000a6 color-management-v1: add EXT_LINEAR 2025-06-18 19:37:55 +00:00
Simon Ser
dc258b2237 output: add transfer function to image description 2025-06-18 00:11:33 +02:00
Simon Ser
e64de4d55f output: add color primaries to output state 2025-06-18 00:07:58 +02:00
Simon Ser
a30c102163 output: drop gamma LUT from state
This has been superseded by color transforms.
2025-06-16 09:06:10 +00:00
Simon Ser
bfcb4211f6 wlr_gamma_control_v1: use color transforms 2025-06-16 09:06:10 +00:00
Simon Ser
97f6946c8d output: add color transform to state
Color transforms are better suited than raw gamma tables, because:

- They don't need to get copied around: they are ref'counted.
- They can represent more color operations (will be useful for the
  upcoming KMS color pipeline API, and for the Wayland color
  management protocol).
2025-06-16 09:06:10 +00:00
Simon Ser
c6133f9912 scene: send surface preferred transform alongside DMA-BUF feedback
wl_surface.preferred_buffer_transform is mainly useful to make
direct scan-out more likely. It shouldn't make a difference with
GL/Vulkan rendering.
2025-06-16 07:54:00 +00:00
Simon Ser
6204fc3278 scene: use output with highest refresh rate for frame pacing
If a surface is mirrored on two outputs, we don't want to pick the
first output if the second has a higher refresh rate.

Also fixes duplicate frame/feedback events when a surface is added
to multiple scenes.
2025-06-16 07:54:00 +00:00
Simon Ser
51d051497d scene: filter frame_done primary output in surface handler
This lets the surface handler decide which output to send frame
callbacks from. The output_sample event already works this way.

Introduce wlr_scene_surface_send_frame_done() as a replacement for
wlr_scene_buffer_send_frame_done() when a compositor doesn't have
an output at hand.
2025-06-16 07:54:00 +00:00
Simon Ser
8713ac72fb scene: configure clients with the highest output scale
If a surface appears on two outputs with the same intersection
area, or even if a surface appears on an output with a small
intersection area, we want to use the highest scale.

Fixes flip-flop when a surface is added to multiple scenes.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3901
2025-06-16 07:54:00 +00:00
Simon Ser
95b2771bfd scene: ignore outputs with too small intersection with nodes
If a node has a very small intersection with an output, there's no
point in trying to adapt the node's rendering to that output.
2025-06-16 07:54:00 +00:00
Simon Ser
da820070f4 ext_image_capture_source_v1: add helper to capture scene nodes 2025-06-16 07:54:00 +00:00
Simon Ser
b066fd6b5a ext_image_capture_source_v1: add support for foreign toplevels 2025-06-16 07:54:00 +00:00
Simon Ser
37992cf3b8 idle_notify_v1: drop trailing spaces 2025-06-15 12:25:36 +00:00
Kirill Primak
afe427d149 xdg-shell: add support for v7 2025-06-05 16:25:25 +00:00
Kirill Primak
af43d3b9e7 cursor-shape-v1: bump to version 2 2025-05-22 20:35:30 +03:00
Kirill Primak
aaeffe9769 cursor-shape-v1: use generated enum validator 2025-05-22 20:35:15 +03:00
Guido Günther
2d5492c737 text-input-v3: Use NULL when emitting signals
Listeners can use `wl_container_of`.

Helps: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3851

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-15 13:36:58 +00:00
Guido Günther
536100488f text-input-v3: Name new text input event correctly
Helps: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3851

Signed-off-by: Guido Günther <agx@sigxcpu.org>
2025-05-15 13:36:58 +00:00
Martin Rys
62c86fb975 Add support for XKB_LED_NAME_COMPOSE and XKB_LED_NAME_KANA USB HID LEDs
Requires xkbcommon 1.8.0
2025-05-15 09:14:48 +00:00
Simon Ser
c2327248f8 output: don't send make/model
- These are legacy wl_output properties [1]
- wl_output exposes name and description, which are better defined
- It's not clear what make/model/serial are for a virtual output
- Clients shouldn't rely on these fields

[1]: 8f1795f911/protocol/wayland.xml (L2508)

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1623
2025-05-15 09:04:33 +00:00
David Turner
c9f0dbc159 Change all timespec pointers in events to owned
Follow-up from !4803.  Make things consistent by making all `struct
timespec`s in events owned.  Reduces the need for thinking about
ownership/lifetimes.
2025-05-15 08:59:56 +00:00
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
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
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
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
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
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
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