Commit graph

2833 commits

Author SHA1 Message Date
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
columbarius
9e426e70e6 ext-foreign-toplevel-list-v1: new protocol implementation
This implements the new ext-foreign-toplevel-list-v1 protocol [1].
Implemented analog to the zwlr-foreign-toplevel-management-v1 implementation.
The additional _ext_ in the names was added to avoid name collisions.

[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/187

Co-authored-by: Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de>
2024-02-12 01:05:19 +01:00
Austin Shafer
4cd556ea20 linux_dmabuf_v1: allow callbacks for checking dmabuf import 2024-02-06 16:11:30 +00:00
Kirill Primak
811ca199c4 xdg-shell: drop automatic surface configuration
Compositors now are expected to wait for an initial commit by checking
wlr_xdg_surface.initial_commit on every surface commit and send
(schedule) configure events manually.
2024-02-06 13:48:00 +00:00
Austin Shafer
d368028bd5 allocator: remove backend parameter in allocator_autocreate_with_drm_fd
Since we only use the backend capabilities here we can simply pass
them in directly. This allows other locations to create an allocator
even if they don't have a backend. They can simply specify the caps
they want instead.
2024-02-02 16:36:31 -05:00
Simon Ser
a8aeadeab2 switch: add docs 2024-02-02 17:52:56 +01:00
Simon Ser
967e788bc8 backend/session: add docs 2024-02-01 16:08:47 +01:00
Kirill Primak
7dfbd87771 compositor: drop wlr_surface.external_damage 2024-02-01 14:51:43 +00:00
Leo Li
71fb55f3bf render/pixel-format: Move has_alpha into it's own array
Some opaque pixel formats (nv12, p010) require per-plane bytes_per_block
info. However, it doesn't make sense to store them in
wlr_pixel_format_info, as they will never be useful (currently, this
info is used for shm, which doesn't have a concept of multi-planar
buffers.)

Let's define a separate array and function for determining whether a
pixel format has alpha.
2024-01-31 13:47:17 -05:00
Andri Yngvason
3a91dc1b48 Create & implement transient seat protocol 2024-01-31 08:22:05 +00:00
Simon Ser
6991f03767 linux-dmabuf-v1: switch to stable
The protocol is no longer unstable.
2024-01-31 08:20:17 +00:00
Simon Ser
ba3c1ae065 linux-dmabuf-v1: fix include guard name 2024-01-31 08:20:17 +00:00
Alexander Orzechowski
8dff1bb9bd wlr_damage_ring: Replace wlr_damage_ring_rotate_buffer with original list impl
The seq based implementation is complex to reason about and doesn't even
work.
2024-01-29 19:17:39 +00:00
Kirill Primak
4688a371e0 compositor: don't get buffer from pending buffer resource too early
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3795
2024-01-27 17:48:07 +03:00
Simon Ser
4ec901bb33 scene: release shm buffers once uploaded
Once a shm buffer is uploaded there's no reason for wlr_scene_buffer
to keep it locked any further. Allow the compositor to re-use it.
2024-01-27 12:21:54 +00:00
Kirill Primak
0052078bd3 compositor: introduce wlr_surface_reject_pending() 2024-01-27 12:05:05 +00:00
Simon Ser
d1b39b5843 backend: take wl_event_loop instead of wl_display in wlr_backend_autocreate() 2024-01-25 15:05:36 +00:00
Simon Ser
f27808b8d9 backend/multi: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser
54f9944b48 backend/drm: drop wl_display argument
We can grab the event loop from the wlr_session instead.
2024-01-25 15:05:36 +00:00
Simon Ser
b62ac611c8 backend/x11: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser
ed0bba581b backend/wayland: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Simon Ser
f5e8fa48f3 backend/libinput: drop wl_display argument
We can grab the event loop from the wlr_session instead.
2024-01-25 15:05:36 +00:00
Simon Ser
682dbf36e5 backend/headless: take wl_event_loop instead of wl_display 2024-01-25 15:05:36 +00:00
Grigory Kirillov
0867dd4e6b xwayland: add support for _NET_WM_WINDOW_TYPE_DESKTOP atom 2024-01-25 19:27:37 +03:00
Simon Ser
4ad6e6c298 backend: destroy multi backend when primary backend is
This makes it easy for compositors to handle situations where the
DRM or libinput backend becomes unavailable. Compositors can listen
the destroy event of the multi backend returned by
wlr_backend_autocreate() and decide what to do.
2024-01-25 14:58:00 +03:00
Alexander Orzechowski
cca2bfbe92 output: Drop pending state 2024-01-24 18:46:45 +00:00
Simon Ser
98c708618e backend/wayland: populate pointer axis relative direction 2024-01-23 08:37:29 +00:00
Simon Ser
00bb1b0f84 seat/pointer: add support for axis_relative_direction event 2024-01-23 08:37:29 +00:00
Simon Ser
88b16bac54 pointer: add support for axis relative direction 2024-01-23 08:37:29 +00:00
Isaac Freund
7129eaa1f2 keyboard: fix type of wlr_keyboard_modifiers.group
This isn't a breaking change since both of these typedefs are uint32_t
but this should make things a bit less confusing for readers.
2024-01-17 11:00:52 +03:00
MaxVerevkin
48721bca65 fix outdated comment in wlr_output.h 2024-01-07 00:03:27 +02:00
Simon Ser
d0da76fbf6 wl_drm: add deprecation notice 2024-01-03 20:52:34 +00:00
Simon Ser
57d7d79982 region: add docs for wlr_region_scale_xy() and wlr_region_confine() 2024-01-03 21:19:41 +03:00
Simon Ser
f81c3d93cd backend/drm: save current refresh rate
wlr_output.refresh is populated by core wlr_output, and thus will
be zero for a custom mode with an unset refresh rate.

Save the refresh rate from the drmModeModeInfo in wlr_drm_connector
instead.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3791
2023-12-30 20:06:33 +01:00
Simon Ser
ab924064f2 scene: drop wlr_scene_set_presentation() 2023-12-27 13:41:20 +01:00