From 57541ffff89bc3ba7330a6a6404eae07575bfeb0 Mon Sep 17 00:00:00 2001 From: Matthieu Herrb Date: Tue, 27 Jul 2010 19:33:04 +0000 Subject: Additional fix for the wscons keyboard layout detection code. If the layout is 'user', fall back to the "us" layout. Problem spotted by naddy@. --- driver/xf86-input-keyboard/src/bsd_kbd.c | 11 +++++++---- driver/xf86-input-keyboard/src/kbd.c | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'driver/xf86-input-keyboard') diff --git a/driver/xf86-input-keyboard/src/bsd_kbd.c b/driver/xf86-input-keyboard/src/bsd_kbd.c index b981e1289..ef09612f8 100644 --- a/driver/xf86-input-keyboard/src/bsd_kbd.c +++ b/driver/xf86-input-keyboard/src/bsd_kbd.c @@ -22,6 +22,7 @@ #include "xf86.h" #include "xf86Priv.h" #include "xf86_OSlib.h" +#include "xf86Parser.h" #include "xf86Xinput.h" #include "xf86OSKbd.h" @@ -59,6 +60,8 @@ struct nameint kbdopt[] = { extern void KbdGetMapping(InputInfoPtr pInfo, KeySymsPtr pKeySyms, CARD8 *pModMap); +extern int priv_open_device(const char *dev); + extern Bool VTSwitchEnabled; static KbdProtocolRec protocols[] = { @@ -496,8 +499,6 @@ OpenKeyboard(InputInfoPtr pInfo) * XkbLayout has been specified. Do this even if the protocol is * not wskbd. */ - if (xf86findOption(pInfo->options, "XkbLayout") != NULL) - return TRUE; if (ioctl(pInfo->fd, WSKBDIO_GETENCODING, &wsenc) == -1) { /* Ignore the error, we just use the defaults */ @@ -505,9 +506,11 @@ OpenKeyboard(InputInfoPtr pInfo) pInfo->name, strerror(errno)); return TRUE; } - if (KB_ENCODING(wsenc) == KB_USER) - /* Don't try to set XkbLayout */ + if (KB_ENCODING(wsenc) == KB_USER) { + /* Ignore wscons "user" layout */ + xf86Msg(X_INFO, "%s: ignoring \"user\" wscons layout", pInfo->name); return TRUE; + } for (i = 0; kbdenc[i].val; i++) if(KB_ENCODING(wsenc) == kbdenc[i].val) { diff --git a/driver/xf86-input-keyboard/src/kbd.c b/driver/xf86-input-keyboard/src/kbd.c index c6f119291..1e2981a8e 100644 --- a/driver/xf86-input-keyboard/src/kbd.c +++ b/driver/xf86-input-keyboard/src/kbd.c @@ -122,6 +122,7 @@ static const char *kbdDefaults[] = { "AutoRepeat", "500 30", "XkbRules", "xorg", "XkbModel", "pc105", + "XkbLayout", "us", "CustomKeycodes", "off", NULL }; -- cgit v1.2.3