Commit Graph

2601 Commits

Author SHA1 Message Date
Alexander Orzechowski
a9375d6bac wlr_scene: Drop map/unmap listeners from layer_shell_v1
Redundant.
2024-07-04 14:10:33 -04:00
Alexander Orzechowski
48b9b7d406 wlr_scene: Drop map/unmap listeners from drag_icon
Redundant.
2024-07-04 14:09:47 -04:00
Alexander Orzechowski
24a9f88873 wlr_scene: Drop map/unmap listeners from xdg_shell
subsurface_tree will handle it. This was redundant.
2024-07-04 14:08:24 -04:00
Alexander Orzechowski
65e6579c56 wlr_scene: send preferred buffer transform 2024-06-28 13:44:35 -04:00
Simon Ser
fe429b2463 Switch to stable tablet-v2 protocol
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/284
2024-06-27 18:04:00 +00:00
Simon Ser
213bd88b4c linux-drm-syncobj-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/90
2024-06-12 18:40:25 +02:00
Kirill Primak
f464213447 input-method: unmap popup surfaces on deactivate
Fixes 743da5c0ae
2024-06-11 13:13:00 +00:00
Kirill Primak
1e58e4006d xdg-popup: validate positioner on reposition request 2024-06-11 12:02:35 +03:00
Kirill Primak
e7deea44fd xdg-popup: don't emit parent's new_popup signal too early 2024-06-11 11:28:09 +03:00
Simon Ser
dc5996a8b4 seat/keyboard: drop unnecessary check in handle_keyboard_keymap()
This condition always holds true: the listener is set up for
state->keyboard.
2024-05-27 23:08:20 +00:00
Kenny Levinsen
13b9b54f3f wlr_scene: Skip direct scanout on color transform
If we need to apply a color transform to rendered content, we will not
be able to use direct scanout. Explicitly skip it to not accidentally
show frames lacking the color transform.
2024-05-24 17:24:32 +02:00
JiDe Zhang
36c0d5fe3a output: reset hardware_cursor on failure
The DRM backend's set_cursor function always return true if the
buffer is NULL. If using a NULL cursor's buffer on startup, the
wlr_output_cursor will be marked as a hardware cursor. If the
cursor later gains a non-NULL buffer and the DRM backend rejects
that buffer, the cursor will remain marked as a hardware cursor,
despite the backend not displaying it as such. As a result, the
cursor will not be displayed at all. Fix this by always resetting
the hardware_cursor field in output_cursor_attempt_hardware().
2024-05-23 09:32:16 +02:00
Kirill Primak
510664e79b output: disable hardware cursor when falling back to software 2024-05-07 14:47:05 +00:00
Kirill Primak
f534434be6 output: extract hardware cursor disabling logic 2024-05-07 14:47:05 +00:00
Kirill Primak
9c50cd71b6 xdg-toplevel: allow edge_none for resizing 2024-05-07 09:45:58 +03:00
groveer
293b0aa502 wlr_pointer_gestures_v1: emit destroy signal in destroy function 2024-05-06 10:47:33 +03:00
groveer
dead0ebcc8 wlr_pointer_gestures_v1: init destroy signal 2024-05-06 10:46:42 +03:00
Alexander Orzechowski
53be443f39 wlr_scene: Add WLR_SCENE_HIGHLIGHT_TRANSPARENT_REGION env 2024-05-05 02:22:50 +03:00
Kirill Primak
8fdf9dc4f0 scene: fix double scaling of opaque region for blend mode optimization 2024-05-05 01:54:59 +03:00
Kirill Primak
341154a5f6 alpha-modifier-v1: add a missing NULL check in wlr_alpha_modifier_v1_get_surface_state() 2024-05-01 03:07:16 +03:00
Simon Ser
027d453f6a scene/surface: add support for alpha-modifier-v1 2024-04-30 17:49:34 +02:00
Simon Ser
563f100627 alpha-modifier-v1: new protocol implementation
References: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/287
2024-04-30 17:49:34 +02:00
Manuel Stoeckl
391410deb5 wlr_scene: add color transform argument for rendering 2024-04-26 17:17:36 +00:00
Alexander Orzechowski
41fd552f53 wlr_scene: Set wlr_damage_ring_set_bounds earlier
Fixes the _HIGHLIGHT option not highlighting the buffer correctly after
a resize
2024-04-24 12:58:17 -04:00
Alexander Orzechowski
1dc44a1afe wlr_scene: Schedule new frame for WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT in output commit handler
We were doing it too early before and the output would disregard a
scheduled frame if called when we were first putting together the output
state
2024-04-24 12:58:17 -04:00
Alexander Orzechowski
14692a7c55 wlr_scene: Fix WLR_SCENE_DEBUG_DAMAGE_HIGHLIGHT output damage 2024-04-24 12:58:17 -04:00
Consolatis
e70afebfc9 scene: do not reset scene_buffer state on buffer release
This fixes an issue with some buffers not rendering anymore due
to buffer_width and buffer_height being reset on buffer release.
2024-04-23 19:37:28 +02:00
Simon Ser
ebef710746 renderer: replace get_render_buffer_caps() with struct field 2024-04-22 11:38:30 +02:00
Simon Ser
0686666cf5 render: drop wlr_renderer_get_dmabuf_texture_formats()
wlr_renderer_get_texture_formats() with WLR_BUFFER_CAP_DMABUF is
the replacement.
2024-04-21 11:27:29 +00:00
Simon Ser
85c1eda721 render: unify getter for texture formats
Instead of having separate getters for shm formats and DMA-BUF
formats, use the same pattern as wlr_output_impl.get_primary_formats
with a single function which takes buffer caps as input.
2024-04-21 11:27:29 +00:00
Ilia Bozhinov
75ecba444a seat: add serials to touch up events 2024-04-18 14:34:51 +00:00
Kirill Primak
2f82c92307 Avoid using wayland-{client,server}.h
Their use is discouraged. Instead, include -core or -protocol headers.
2024-04-17 13:37:12 +00:00
Isaac Freund
cb01c63a8d
scene: ensure layer surface usable area >0
Clients may, for example, commit an exclusive zone larger than the
output dimensions. Compositors must handle this gracefully, which likely
requires more work on the compositor side but returning a usable area
with negative width or height in wlr_scene_layer_surface_v1_configure()
is nonsensical.
2024-04-16 11:49:08 +02:00
Kenny Levinsen
f0ce906b73 wlr_gamma_control: Store gamma size when creating control
When a wlr_gamma_control client calls set_gamma, we allocate a LUT based
on the value returned from wlr_output_get_gamma_size at the time of the
call.

If the output is off and has no CRTC, such as if gamma changes in the
background while a display is disabled for idle reasons,
wlr_output_get_gamma_size returns 0. This leads to a zero-sized table,
which the drm backend interprets as a request to reset gamma tables to
their default.

Store the gamma size when the gamma control was created. Even if the
size changes, this is the size the client was sent and uses to create
the LUTs it sends.
2024-04-01 23:00:48 +02:00
Isaac Freund
34219b0334 touch: make cancel functions take a wlr_seat_client
The surface argument is only used to obtain a wlr_seat_client and
semantically makes no sense. The wl_touch.cancel event applies to all
touch points and all surfaces of a client.

I decided to make the functions accept a wlr_seat_client rather than a
wl_client as it is directly available in the wlr_touch_point struct and
simplifies the implementation.
2024-03-28 09:33:54 +00:00
Kirill Primak
072f6ed977 viewporter: fix "has buffer" check
Previously, cases when a viewport source box was updated without attaching
a buffer weren't checked for correctness properly because the state's buffer
would be NULL. Use wlr_surface_state_has_buffer() instead.
2024-03-24 02:20:18 +00:00
Vaxry
538a7a190d types/text-input-v3: assert on invalid _leave() and _enter() calls
It's invalid usage, but shouldn't cause memory mayhem, assert instead
2024-03-22 21:34:48 +00:00
Alexander Orzechowski
94c31b824c screencopy: Add some logging 2024-03-22 11:36:12 -04:00
Alexander Orzechowski
3224fe6a51 screencopy: Remove dead code 2024-03-22 11:33:10 -04:00
Isaac Freund
b7d003caef
scene: constify subsurface_tree_set_clip() 2024-03-20 12:56:28 +01:00
Isaac Freund
5a5aa72571 security-context: constify lookup_client()
This is worth doing despite wl_client_get_destroy_listener() incorrectly
accepting a mutable wl_client pointer since this lookup_client()
function will primarily be used with a wl_display_global_filter_func_t
which only provides a const wl_client pointer.

Work around this libwayland API wart in wlroots so compositors don't
have to.
2024-03-18 08:18:51 +00:00
Isaac Freund
c5eda09166 single-pixel-buffer: make wl_global public
I wish to use a allowlist of globals for my security context
implementation rather than a blocklist, which means I need access to
the wp_single_pixel_buffer_manager_v1 global in order to allowlist it.

I think using a allowlist will make it harder for me to accidentally
expose globals to a security context that were meant to be restricted.
2024-03-18 08:12:53 +00:00
Isaac Freund
af4987c751 idle-notify: make wl_global public
I wish to use a allowlist of globals for my security context
implementation rather than a blocklist, which means I need access to
the ext_idle_notifier_v1 global in order to allowlist it.

I think using a allowlist will make it harder for me to accidentally
expose globals to a security context that were meant to be restricted.
2024-03-18 08:12:53 +00:00
Isaac Freund
0398d1b85a wlr_shm: make wl_global public
I wish to use a allowlist of globals for my security context
implementation rather than a blocklist, which means I need access to
the wl_shm global in order to allowlist it.

I think using a allowlist will make it harder for me to accidentally
expose globals to a security context that were meant to be restricted.
2024-03-18 08:12:53 +00:00
Simon Ser
bda1b41ee2 output-swapchain-manager: new helper
This new helper assists compositors in allocating buffers for
modesets. It degrades to different allocation parameters as
needed, and should help with screens not turning on when multiple
outputs are connected on some hardware (e.g. Intel).

For simplicity, the old logic to try allocating with explicit
modifiers first and then fallback to implicit modifiers later is
left as-is. We'll probably want to have more complicated logic
instead in the future: try the fallback on one output at a time,
and try dropping modifiers one by one instead of using implicit
modifiers (at the cost of some combinatorial explosion).

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/1873
Co-authored-by: Kenny Levinsen <kl@kl.wtf>
2024-03-14 22:08:01 +00:00
Simon Ser
2ff3479558 output-management-v1: add wlr_output_configuration_v1_build_state()
A convenience function to make it easier for compositors to
implement the protocol.
2024-03-14 22:03:10 +00:00
Simon Ser
78c76ddd09 backend: add wlr_backend_{test,commit}() 2024-03-14 22:03:10 +00:00
Simon Ser
859373b253 scene: listen to renderer destroy in wlr_scene_buffer
When a renderer is destroyed, so are all textures. Reset the
texture in that case.
2024-03-14 22:07:42 +01:00
Simon Ser
3d9f330ee0 scene: add scene_buffer_set_texture() 2024-03-14 22:06:10 +01:00
Simon Ser
f0d8377732 output: listen to renderer destroy in wlr_output_cursor
When a renderer is destroyed, so are all textures. Reset the
texture in that case.
2024-03-14 22:05:59 +01:00