xephyr: fix keymap, pointer; dix: fix multiple axes

Initialise our axes properly in the DIX, and make sure we don't
unnecessarily clip maxval when it's not set.
Fix keymap copying in Xephyr (to some degree: it's still broken),
and set nAxes and nButtons properly.
This commit is contained in:
Daniel Stone 2006-07-20 18:38:57 -04:00 • committed by Daniel Stone
commit 7711c56d2e
4 changed files with 19 additions and 16 deletions

View file

@ -863,10 +863,10 @@ MouseInit (KdPointerInfo *pi)
pi->driverPrivate = (EphyrPointerPrivate *)
xcalloc(sizeof(EphyrPointerPrivate), 1);
((EphyrPointerPrivate *)pi->driverPrivate)->enabled = FALSE;
pi->nAxes = 3;
pi->nButtons = 32;
ephyrMouse = pi;
/* FIXME DO NOT COMMIT */
KdAddPointerDriver(&EphyrMouseDriver);
ErrorF("SUCCESS!\n");
return Success;
}
@ -874,7 +874,6 @@ static Status
MouseEnable (KdPointerInfo *pi)
{
((EphyrPointerPrivate *)pi->driverPrivate)->enabled = TRUE;
ErrorF("SUCCESS ENABLE!\n");
return Success;
}

View file

@ -675,13 +675,6 @@ hostx_load_keymap(void)
max_keycode - min_keycode + 1,
&host_width);
ephyrKeySyms.map = (KeySym *)calloc(sizeof(KeySym),
(max_keycode - min_keycode + 1) *
width);
if (!ephyrKeySyms.map)
return;
/* Try and copy the hosts keymap into our keymap to avoid loads
* of messing around.
*
@ -690,15 +683,21 @@ hostx_load_keymap(void)
*/
width = (host_width > 4) ? 4 : host_width;
ephyrKeySyms.map = (KeySym *)calloc(sizeof(KeySym),
(max_keycode - min_keycode + 1) *
width);
if (!ephyrKeySyms.map)
return;
for (i=0; i<(max_keycode - min_keycode+1); i++)
for (j=0; j<width; j++)
kdKeymap[ (i*width)+j ] = keymap[ (i*host_width) + j ];
ephyrKeySyms.map[(i*width)+j] = keymap[(i*host_width) + j];
EPHYR_DBG("keymap width, host:%d kdrive:%d", host_width, width);
ephyrKeySyms.minKeyCode = min_keycode;
ephyrKeySyms.maxKeyCode = max_keycode;
ephyrKeySyms.mapWidth = (width > 4) ? 4 : width;
ephyrKeySyms.mapWidth = width;
XFree(keymap);
}