Merge branch 'spawn-func' into 'master'

Draft: xwayland: Introduce xwayland_spawn_func_t

See merge request wlroots/wlroots!5011
This commit is contained in:
Kenny Levinsen 2025-04-21 08:00:33 +00:00
commit 08ff543344
4 changed files with 68 additions and 76 deletions

View file

@ -14,16 +14,24 @@
#include <time.h>
#include <wayland-server-core.h>
/**
* Xwayland spawn function. pathname and args are compatible with the execv
* family of functions. envp is a NULL terminated list of enironment variables
* that must be added before exec, while uncloexec is a -1 terminated list of
* file descriptors that must have CLOEXEC unset after fork but before exec.
*/
typedef bool (*xwayland_spawn_func_t)(char *pathname, char *args[], char *envp[], int uncloexec[]);
struct wlr_xwayland_server_options {
bool lazy;
bool enable_wm;
bool no_touch_pointer_emulation;
bool force_xrandr_emulation;
int terminate_delay; // in seconds, 0 to terminate immediately
xwayland_spawn_func_t spawn_handler;
};
struct wlr_xwayland_server {
pid_t pid;
struct wl_client *client;
struct wl_event_source *pipe_source;
int wm_fd[2], wl_fd[2];

View file

@ -15,6 +15,7 @@
#include <xcb/xcb_ewmh.h>
#include <xcb/xcb_icccm.h>
#include <wlr/util/addon.h>
#include <wlr/xwayland/server.h>
struct wlr_box;
struct wlr_xwm;
@ -266,7 +267,7 @@ struct wlr_xwayland_minimize_event {
* client tries to connect.
*/
struct wlr_xwayland *wlr_xwayland_create(struct wl_display *wl_display,
struct wlr_compositor *compositor, bool lazy);
struct wlr_compositor *compositor, bool lazy, xwayland_spawn_func_t spawn_func);
/**
* Create an XWM from an existing Xwayland server.