[mutter/wip/wayland-display] wayland: start XWayland in the background
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/wayland-display] wayland: start XWayland in the background
- Date: Tue, 23 Jul 2013 17:11:33 +0000 (UTC)
commit 583632ed4abc4fc8334e51acac222c15f95650c9
Author: Giovanni Campagna <gcampagn redhat com>
Date: Tue Jul 23 15:38:33 2013 +0200
wayland: start XWayland in the background
When debugging it's useful to send Ctrl+C to mutter, but we
don't want xwayland getting that.
src/wayland/meta-wayland.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/wayland/meta-wayland.c b/src/wayland/meta-wayland.c
index c3c2560..7bf2c68 100644
--- a/src/wayland/meta-wayland.c
+++ b/src/wayland/meta-wayland.c
@@ -1282,7 +1282,7 @@ bind_to_unix_socket (int display)
}
static void
-uncloexec (gpointer user_data)
+uncloexec_and_setpgid (gpointer user_data)
{
int fd = GPOINTER_TO_INT (user_data);
@@ -1291,6 +1291,10 @@ uncloexec (gpointer user_data)
int flags = fcntl (fd, F_GETFD);
if (flags != -1)
fcntl (fd, F_SETFD, flags & ~FD_CLOEXEC);
+
+ /* Put this process in a background process group, so that Ctrl-C
+ goes to mutter only */
+ setpgid (0, 0);
}
static void
@@ -1398,7 +1402,7 @@ start_xwayland (MetaWaylandCompositor *compositor)
G_SPAWN_DO_NOT_REAP_CHILD |
G_SPAWN_STDOUT_TO_DEV_NULL |
G_SPAWN_STDERR_TO_DEV_NULL,
- uncloexec,
+ uncloexec_and_setpgid,
GINT_TO_POINTER (sp[1]),
&pid,
&error))
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]