Commit Graph

2867 Commits

Author SHA1 Message Date
Mihai Fufezan a336b9b1fb Meson: install headers in hyprland subdir 2024-05-11 02:01:59 +03:00
Simon Ser 73d2fd4d4f xwayland: add a few docs 2024-04-10 18:12:56 +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 2f3ea4590a viewporter: fix outdated docs
wlr_render_subtexture_with_matrix() has been removed.
2024-03-25 17:48:07 +00:00
Ian Forbes e3bd318547 drm/backend: add support for cursor hotspots
Enables DRM_CLIENT_CAP_CURSOR_PLANE_HOTSPOT and sets the cursor hotspots on the
cursor plane so virtualized drivers can accelerate mouse movement.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3776
2024-03-22 13:54:18 -05:00
Isaac Freund b7d003caef
scene: constify subsurface_tree_set_clip() 2024-03-20 12:56:28 +01:00
Simon Ser 873e8e4558 tablet-tool: document event data 2024-03-18 13:02:32 +00: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 52e01a9c8b backend/drm: implement wlr_backend_impl.{test,commit} 2024-03-14 22:03:10 +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 fc4996d853 backend/drm: rework struct wlr_drm_page_flip for multiple connectors
We need to store the CRTC ID for each connector at the time of the
atomic commit, because future commits may change the CRTC/connector
mapping.
2024-03-14 22:03:10 +00:00
Simon Ser 805807fd5b backend/drm: add infrastructure for device-wide commits 2024-03-14 22:03:10 +00:00
Simon Ser 4636f8c407 backend/drm: track pending atomic state in wlr_drm_connector_state
This centralizes logic common for both the atomic and libliftoff
backends. Additionally, a struct will make it easier to implement
multi-connector commits (since it can be stored in an array).
2024-03-14 22:03:10 +00:00
Simon Ser f8f2dde1f0 backend/drm: add wlr_drm_connector_state.connector
Will be useful for multi-connector commits, to avoid having to
pass the list of connectors separately from their state.
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 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
Simon Ser 9e3576426d buffer: listen to renderer destroy in wlr_client_buffer
When a renderer is destroyed, so are all textures. Reset the
texture in that case.
2024-03-14 22:03:13 +01:00
Simon Ser 0e5034d8ba compositor: add wlr_compositor_set_renderer()
Allows compositors to switch the wlr_renderer at runtime.

Useful for handling GPU resets.
2024-03-14 14:34:44 +01:00
Simon Ser 3075e6a6f9 compositor: use compositor to get renderer
This allows us to remove the renderer destroy listener. The
listener was buggy: compositors can't destroy surface resources on
their own.

The wlr_compositor will always outlive the wlr_surface, so no need
for a destroy listener.
2024-03-14 12:29:01 +00:00
Simon Ser 508d8c9a01 compositor: handle renderer destroy
Don't leave a stale renderer pointer behind.
2024-03-14 12:29:01 +00:00
Alexander Orzechowski 8da93e5936 wlr_scene: Add support for custom swapchains 2024-03-12 11:26:03 -04:00
Vaxry 50eae512d9 xwayland: add wlr_xwayland_get_xwm_connection
Allows the compositors to get the xwm connection
2024-03-09 11:21:17 +00:00
Simon Ser edbf8bf2ce input-device: drop wlr_input_device.{vendor,product}
These aren't super useful without the bus type. Compositors can
fish back this information from the libinput device if they want to.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3818
2024-03-07 11:08:18 +00:00
Simon Ser e21b975f5d tablet-tool: add usb_vendor_id and usb_product_id to wlr_tablet 2024-03-07 11:08:18 +00:00
Isaac Freund 22178451f7
cursor-shape-v1: expose tablet tool in event
This allows compositors which use a separate cursor per tablet tool to
support setting tablet tool cursors individually using this protocol.
2024-03-05 11:20:05 +01:00
Simon Ser 16b42bf65b backend/drm: track cursor FB in wlr_drm_connector_state
Use the same logic for cursor FBs as we currently use for primary
FBs. This also fixes the same bug as [1] but in a different, more
robust way.

The new logic integrates better with atomic and will be required
anyways in the future when set_cursor will be superseded by a better
API.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4577
2024-03-04 11:26:20 +01:00
Simon Ser f6659414ba backend/drm: add drm_fb_copy()
Similar to drm_fb_move(), but leaves old as-is.
2024-03-04 11:25:33 +01:00
Isaac Freund 2a897af7dc
wlr_tablet_v2: fix destroy listener name 2024-02-29 16:09:08 +01:00
Isaac Freund b821be5749
input-device: unconfuse tablet naming
WLR_INPUT_DEVICE_TABLET_TOOL is renamed to WLR_INPUT_DEVICE_TABLET

The input device corresponds to wlr_tablet, not wlr_tablet_tool.
2024-02-29 16:09:07 +01:00
Simon Ser cfd605705f input-device: fix WLR_INPUT_DEVICE_TABLET_TOOL doc comment
wlr_tablet_tool is not a wlr_input_device.

The name is confusing, but changing it would be a breaking change.
Let's fix the docs as a first step.
2024-02-29 12:43:08 +01:00
Simon Ser ee70932422 backend/libinput: use NULL to indicate missing device name
libinput guarantees that the name is non-NULL, and an empty string
if unset. However wlroots uses NULL to indicate that an input device
name is unset.
2024-02-29 12:08:02 +01:00
Simon Ser 488a23c169 pointer: drop enum wlr_axis_orientation
Instead, use enum wl_pointer_axis from the Wayland protocol.
2024-02-28 16:39:18 +00:00
Simon Ser ec5263e6b7 pointer: drop enum wlr_axis_relative_direction
Instead, use enum wl_pointer_axis_relative_direction from the
Wayland protocol.
2024-02-28 16:39:18 +00:00
Simon Ser 812451cd8f pointer: use enum wl_pointer_button_state 2024-02-28 16:39:18 +00:00
Simon Ser 9f4cf242d9 pointer: drop enum wlr_axis_source
Instead, use enum wl_pointer_axis_source from the Wayland protocol.
2024-02-28 16:39:18 +00:00
Simon Ser c45e97f3a5 input-device: add doc comments 2024-02-28 11:31:54 +01:00
Simon Ser 54e1fefd2e render/egl: drop wlr_egl_is_current()
This is unused.
2024-02-23 18:52:48 +01:00
Simon Ser c31d307971 render/egl: drop wlr_egl_save_context()
This is no longer used.
2024-02-23 18:52:48 +01:00
Simon Ser d5556ec78f render/egl: add save_context parameter to wlr_egl_make_current()
Saving the old context and immediately making our own context
current is a common pattern. Let's make it easier to do.

No functional change, just refactoring.
2024-02-23 18:52:48 +01:00
John Lindgren 2521fba37c xwayland: add map_request signal
For XWayland surfaces that start maximized, it's best to send an initial
Configure event to set the size of the surface before mapping it. This
reduces visual glitches since the application sees the correct maximized
size when performing its initial layout and drawing.

wlroots surfaces emit their first "map" event after the XWayland window
has already been mapped and the first frame has been drawn & committed.
This is too late to send the initial Configure event.

So, add a new "map_request" event which is emitted immediately before
telling XWayland to map the window. Compositors can connect to this
event to send the initial Configure event to an XWayland app based on
its requested maximized (or fullscreen) state.

Compositors should not place anything visually on the screen at this
point but rather wait until the "map" event as before.
2024-02-23 12:46:25 -05:00
Simon Ser 0d9ffef774 backend/drm: don't destroy previous DRM master blobs
On startup, we fetch the previous MODE_ID blob ID so that
compositors can keep using the previous mode if they want to.
However, that blob doesn't belong to us, it belongs to the
previous DRM master. As a result, we get an error when trying to
destroy it.

Fix this by tracking whether the blob belongs to us or not.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3811
2024-02-21 15:10:44 +00:00
Simon Ser d8f4a3d78c backend/drm: fix broken link to KMS property docs
The Linux graphics section of 01.org is no more. Link to more
official docs instead.
2024-02-21 12:03:37 +01:00
Simon Ser d2acd4c362 backend/drm: move restore logic to drm.c
We'll need to use a bunch of internal functions from that file in
the next commits.
2024-02-15 09:37:46 +01:00
Simon Ser 505175e56f backend/drm: atomically reset state after VT switch
Allows the KMS driver to parallelize the modesets, so should be
faster than going through each CRTC one by one.
2024-02-14 19:13:23 +01:00
Simon Ser 741aaa3f76 backend/drm: drop wlr_drm_backend arg from create_mode_blob()
No need for this, the backend can be grabbed from the connector.
2024-02-14 17:13:25 +01:00