diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-25 13:37:09 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-03-27 08:53:36 +1000 |
commit | 65739ef047233567e6053fc57464a42ffe69e989 (patch) | |
tree | a37bf83b2e57852a5f05fad6903fd865af74e32a | |
parent | 85fe6b8f56e75338fde1d3a88b1749fd105eb93b (diff) | |
download | xorg-driver-xf86-input-keyboard-65739ef047233567e6053fc57464a42ffe69e989.tar.gz |
linux: bring our process group to the foreground (#89653)
Required to make the driver receive keyboard events from the console.
X.Org Bug <http://bugs.freedesktop.org/show_bug.cgi?id=89653>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Ingo Brückl <ib@wupperonline.de>
-rw-r--r-- | src/lnx_kbd.c | 9 |
1 files changed, 9 insertions, 0 deletions
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) { |