summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-25 19:01:10 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-25 19:01:10 -0200
commit6ef46c40e62def4841a4cff4e0b443516a2ed782 (patch)
tree97183d830e45f0631f31884ed4f25c3a8b315e05
parent759348f13ffa02fb1804238189ffce1c92d33e2a (diff)
Update xnest keyboard code to match xephyr/kdrive.
Xnest was not updated in the last batch of xkb changes. This patch is basically cut&paste from hw/kdrive/src/kinput.c and hw/kdrive/ephyr/ephyr.c, and appears to generate a Xnest as functional as before the xkb changes.
-rw-r--r--hw/xnest/Keyboard.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 022816dec..c9b4a1748 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -114,16 +114,15 @@ xnestChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
int
xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
{
- XModifierKeymap *modifier_keymap;
KeySym *keymap;
int mapWidth;
int min_keycode, max_keycode;
KeySymsRec keySyms;
- int i, j;
+ int i;
XKeyboardState values;
XkbComponentNamesRec names;
XkbDescPtr xkb;
- char *rules, *model, *layout, *variants, *options;
+ XkbRMLVOSet rmlvo;
int op, event, error, major, minor;
switch (onoff)
@@ -168,15 +167,14 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
XkbGetControls(xnestDisplay, XkbAllControlsMask, xkb);
memset(&names, 0, sizeof(XkbComponentNamesRec));
- rules = XKB_DFLT_RULES;
- model = XKB_DFLT_MODEL;
- layout = XKB_DFLT_LAYOUT;
- variants = XKB_DFLT_VARIANT;
- options = XKB_DFLT_OPTIONS;
-
- XkbSetRulesDflts(rules, model, layout, variants, options);
- XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms,
- xnestBell, xnestChangeKeyboardControl);
+ rmlvo.rules = XKB_DFLT_RULES;
+ rmlvo.model = XKB_DFLT_MODEL;
+ rmlvo.layout = XKB_DFLT_LAYOUT;
+ rmlvo.variant = XKB_DFLT_VARIANT;
+ rmlvo.options = XKB_DFLT_OPTIONS;
+
+ InitKeyboardDeviceStruct(pDev, &rmlvo,
+ xnestBell, xnestChangeKeyboardControl);
XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls);
XkbFreeKeyboard(xkb, 0, False);
xfree(keymap);
@@ -217,11 +215,26 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev)
void
xnestUpdateModifierState(unsigned int state)
{
+#if 0
DeviceIntPtr pDev = xnestKeyboardDevice;
KeyClassPtr keyc = pDev->key;
int i;
CARD8 mask;
+ if (!pDev)
+ return;
+
+/* This is pretty broken.
+ *
+ * What should happen is that focus out should do as a VT switch does in
+ * traditional servers: fake releases for all keys (and buttons too, come
+ * to think of it) currently down. Then, on focus in, get the state from
+ * the host, and fake keypresses for everything currently down.
+ *
+ * So I'm leaving this broken for a little while. Sorry, folks.
+ *
+ * -daniels
+ */
state = state & 0xff;
if (keyc->state == state)
@@ -260,4 +273,5 @@ xnestUpdateModifierState(unsigned int state)
break;
}
}
+#endif
}