wlroots/include/wlr
Simon Ser 30ccac3a02 buffer: introduce wlr_buffer_acquire()
A footgun in the wlr_buffer API is that there's no difference
between acquiring a buffer and increasing the lock count. In other
words, transitioning a buffer from the released state to the
acquired state is not explicit. This may result in hard-to-debug
failures if there is a dangling released wlr_buffer somewhere
(e.g. wlr_client_buffer.source [1]) and some piece of code calls
wlr_buffer_lock(). In that case, the buffer will be acquired and
released again. In the context of a wlr_buffer issued from a
Wayland protocol wl_buffer object, this can cause the underlying
memory to be used after wl_buffer.release has been sent to the
client, and a double wl_buffer.release event to be sent.

Make it so acquiring a buffer is an explicit operation to make sure
the caller means the state transition and is prepared for a new
release event. wlr_buffer_acquire() forbids calls on already-acquired
buffers, and wlr_buffer_lock() now forbids calls on released buffers.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4904
2024-11-22 11:56:47 +01:00
..
backend Make all listeners private 2024-10-28 18:07:02 +00:00
interfaces pointer: release pressed buttons on destroy 2024-09-24 19:53:54 +00:00
render render/drm_syncobj: add addon set 2024-11-11 15:22:22 +00:00
types buffer: introduce wlr_buffer_acquire() 2024-11-22 11:56:47 +01:00
util Use WLR_PRIVATE for private fields 2024-10-25 07:51:51 +03:00
xwayland Make all listeners private 2024-10-28 18:07:02 +00:00
backend.h backend: add timeline feature flag 2024-10-11 17:11:35 +00:00
config.h.in render/color: introduce wlr_color_transform 2024-04-26 17:17:36 +00:00
meson.build Version pkgconfig, headers, and library for parallel installation 2024-05-27 22:15:00 +00:00
version.h.in Drop WLR_VERSION_API_* 2021-06-29 12:22:55 +02:00
xcursor.h examples, tinywl: use "default" cursor instead of "left_ptr" 2023-02-01 15:00:42 +01:00
xwayland.h xwayland: split headers 2022-11-02 19:00:23 +01:00