diff options
author | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-08-05 15:03:43 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@sun.com> | 2009-08-05 15:04:49 -0700 |
commit | 8e42e8f0034d89ef4b6cee44148961f808ba0602 (patch) | |
tree | 476486e2cd5bafb5f5235697cf80e7b3dcd1e0ba | |
parent | bba90b4e87be3ae5a13d69f6d9c60aa97761c8d5 (diff) |
sun_kbd: re-open keyboard if needed in KbdOn
If we closed keyboard in KbdOff, we need to reopen it in KbdOn, or
will not be able to type after VT switch.
Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
-rw-r--r-- | src/sun_kbd.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sun_kbd.c b/src/sun_kbd.c index 1c87a24..bb831c1 100644 --- a/src/sun_kbd.c +++ b/src/sun_kbd.c @@ -65,6 +65,7 @@ #include <sys/kbd.h> static int KbdOn(InputInfoPtr pInfo, int what); +static Bool OpenKeyboard(InputInfoPtr pInfo); static void CloseKeyboard(InputInfoPtr pInfo); static void @@ -172,6 +173,12 @@ KbdOn(InputInfoPtr pInfo, int what) return Success; } + if (pInfo->fd == -1) { + if (!OpenKeyboard(pInfo)) { + return BadImplementation; + } + } + if (priv->strmod) { SYSCALL(i = ioctl(pInfo->fd, I_PUSH, priv->strmod)); if (i < 0) { |