wayland/src
Isaac Freund d81525a235 client: add wl_display_dispatch_pending_single
As well as wl_display_dispatch_queue_pending_single.

The motivation is writing libwayland bindings for a dynamic language
with exceptions/non-local returns. Since it is invalid for a
wl_dispatcher_func_t callback provided to libwayland to not return,
there is no way to prevent dispatching of further events in the case of
an exception in the dynamic language event handler.

Furthermore, since creating/destroying Wayland objects in an event
handler affects the dispatching of subsequent events by libwayland,
it is not possible to collect Wayland events in a queue outside
libwayland and dispatch them one-by-one after
wl_display_dispatch_pending() returns.

Adding libwayland API to dispatch at most one pending event solves this
problem cleanly. The bindings can have libwayland dispatch a single
event, wait for wl_display_dispatch_pending_single() to return, run the
dynamic language event handler (which may longjmp away), and continue
the loop for as long as there are more events to dispatch.

References: https://codeberg.org/ifreund/janet-wayland
Signed-off-by: Isaac Freund <mail@isaacfreund.com>
2025-09-16 11:48:33 +03:00
..
.gitignore ignore: Add *.dtd.embed 2016-03-10 22:24:20 -08:00
connection.c connection: Add a thread ID to WAYLAND_DEBUG output. 2025-09-15 14:45:53 +01:00
embed.py build: replace assembly embedding with Python script 2021-05-10 22:08:45 +00:00
event-loop.c event-loop: Use timespec utils instead of hand-rolling our own 2025-02-04 14:09:51 +00:00
meson.build build: Add -lm to pkg-config dependencies 2025-02-05 06:52:53 +00:00
scanner.c scanner: use separate guards for validator functions 2025-02-23 23:38:15 +01:00
timespec-util.h timespec: Implement saturating timespec substraction 2025-02-04 14:09:51 +00:00
wayland-client-core.h client: add wl_display_dispatch_pending_single 2025-09-16 11:48:33 +03:00
wayland-client.c client: add wl_display_dispatch_pending_single 2025-09-16 11:48:33 +03:00
wayland-client.h doc: Formalize file comment in wayland-client.h, wayland-server.h 2016-05-11 11:03:27 -07:00
wayland-os.c build: fix build and provide compat for OpenBSD 2024-02-21 15:46:41 +00:00
wayland-os.h shm: Add mmap+memmove fallback if mremap() does not exist 2021-09-10 11:35:54 +00:00
wayland-private.h connection: Add a function to parse WAYLAND_DEBUG tokens 2025-09-15 14:45:53 +01:00
wayland-server-core.h server: add wl_resource_get_interface() 2025-05-20 20:31:16 +00:00
wayland-server-private.h Move wl_priv_signal to wayland-server-private.h 2019-11-06 08:24:14 -06:00
wayland-server.c connection: Add a function to parse WAYLAND_DEBUG tokens 2025-09-15 14:45:53 +01:00
wayland-server.h Put WL_DEPRECATED in front of the function declarations 2024-08-09 20:25:11 +00:00
wayland-shm.c shm: linkify function references in docs 2025-05-20 20:14:52 +00:00
wayland-util.c util: convert macros to inline functions 2024-03-28 17:56:34 +01:00
wayland-util.h connection: Do not busy-loop if a message exceeds the buffer size 2025-06-21 11:29:04 +00:00
wayland-version.h.in src: Update boilerplate from MIT X11 license to MIT Expat license 2015-06-12 15:31:24 -07:00