From 65739ef047233567e6053fc57464a42ffe69e989 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 25 Mar 2015 13:37:09 +1000 Subject: linux: bring our process group to the foreground (#89653) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Required to make the driver receive keyboard events from the console. X.Org Bug Signed-off-by: Peter Hutterer Reviewed-by: Hans de Goede Tested-by: Ingo Brückl --- src/lnx_kbd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/lnx_kbd.c b/src/lnx_kbd.c index 811a7d7..c221194 100644 --- a/src/lnx_kbd.c +++ b/src/lnx_kbd.c @@ -187,8 +187,17 @@ OpenKeyboard(InputInfoPtr pInfo) s = xf86SetStrOption(pInfo->options, "Device", NULL); if (s == NULL) { + int rc; pInfo->fd = xf86Info.consoleFd; pKbd->isConsole = TRUE; + + rc = tcsetpgrp(pInfo->fd, getpgid(0)); + if (rc < 0) { + xf86IDrvMsg(pInfo, X_ERROR, + "failed to set us as foreground pgrp (%s)\n", + strerror(errno)); + } + } else { pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL); if (pInfo->fd == -1) { -- cgit v1.2.1