Commit graph

6 commits

Author SHA1 Message Date
Kenny Levinsen
57f8cf9cd4 xwayland: Introduce xwayland_spawn_func_t
Spawning subprocesses is finicky, and the correct way to do it depends
on the current process state which we have no control of. Signal masks,
handlers, limits, scheduling and open file descriptors are a few
examples of things that inadvertently get inherited and cause issues for
either the parent or the child.

We introduced a temporary workaround against common issues by clearing
signal masks and signal handlers known to cause issues for Xwayland, but
this was only a bandaid.

Introduce xwayland_spawn_func_t, which allows the compositor to specify
an implementation of a process spawner that will be used to launch
Xwayland whenever needed. This spawner can then do any cleanup and
accounting as the compositor sees fit.

The spawner takes 4 arguments: The path to Xwayland, the arguments we
have constructed for Xwayland, the environment variables that must be
set for Xwayland, and the file descriptors that must have CLOEXEC
cleared after fork but before exec to be correctly inherited by
Xwayland.

A default implementation is provided both for convenience and as a
sample for implementers to look at.
2025-03-20 17:13:13 +01:00
Kirill Primak
1520be3c5c Make all listeners private 2024-10-28 18:07:02 +00:00
Simon Ser
bdcf997a89 xwayland/server: add ready flag
Allows one to check whether the server is currently ready.
2023-10-10 17:05:04 +02:00
Simon Ser
d19191ff6b xwayland/server: delay non-lazy startup
This allows users to setup event listeners before the server is
actually started.
2022-11-18 15:35:20 +00:00
Simon Ser
3f40b0031f xwayland/server: add start signal
This can be used to know when wlr_xwayland_server decides to start
a new Xwayland process. At that point the wl_client has already
been created but the Xwayland process hasn't been started yet.
2022-11-18 15:35:20 +00:00
Simon Ser
05454618cd xwayland: split headers
We're about to get one more Xwayland-related thing, and this header
already contains two things.
2022-11-02 19:00:23 +01:00