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 <hideyukn@microsoft.com>
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
dev
Derek Foreman 2 years ago committed by Pekka Paalanen
parent 53f895b476
commit c79e1126b6
  1. 1
      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);

Loading…
Cancel
Save