summaryrefslogtreecommitdiff
path: root/driver/xf86-input-keyboard
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:33:04 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2010-07-27 19:33:04 +0000
commit57541ffff89bc3ba7330a6a6404eae07575bfeb0 (patch)
tree54a8aade9afd6ac3bc3d947294493f992f6035b7 /driver/xf86-input-keyboard
parent186951746554e4cb4b6439489712d95127d29eb9 (diff)
Additional fix for the wscons keyboard layout detection code.
If the layout is 'user', fall back to the "us" layout. Problem spotted by naddy@.
Diffstat (limited to 'driver/xf86-input-keyboard')
-rw-r--r--driver/xf86-input-keyboard/src/bsd_kbd.c11
-rw-r--r--driver/xf86-input-keyboard/src/kbd.c1
2 files changed, 8 insertions, 4 deletions
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
};