From c79e1126b69729c5329ff9b3ecb411e0959b2f65 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 19 Jul 2022 08:23:27 -0500 Subject: [PATCH] xwayland: give Xwayland its own session If we leave xwayland in weston's process group, it can receive signals from the controlling TTY intended for weston. The easiest way to see this is to launch weston under gdb, start an X client, and hit ctrl-c in the gdb session. The Xwayland server will also catch the SIGINT, and the X client will be disconnected. Instead, let's call setsid() when launching Xwayland, like we do for launched clients. Suggested-by: Hideyuki Nagase Signed-off-by: Derek Foreman --- compositor/xwayland.c | 1 + 1 file changed, 1 insertion(+) diff --git a/compositor/xwayland.c b/compositor/xwayland.c index 6113fa51..cf84c882 100644 --- a/compositor/xwayland.c +++ b/compositor/xwayland.c @@ -159,6 +159,7 @@ spawn_xserver(void *user_data, const char *display, int abstract_fd, int unix_fd pid = fork(); switch (pid) { case 0: + setsid(); /* SOCK_CLOEXEC closes both ends, so we need to unset * the flag on the client fd. */ ret = fdstr_clear_cloexec_fd1(&wayland_socket);