Xephyr: stop loading the host's keymap

This isn't used anywhere.

v2: Rebase to the top of the patch series (anholt)

Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
This commit is contained in:
Julien Cristau 2010-06-25 17:59:13 +01:00 committed by Eric Anholt
parent 94d4e29aed
commit 762606b4cd
3 changed files with 2 additions and 36 deletions

View File

@ -1091,7 +1091,7 @@ EphyrKeyboardInit(KdKeyboardInfo * ki)
ki->driverPrivate = (EphyrKbdPrivate *)
calloc(sizeof(EphyrKbdPrivate), 1);
hostx_load_keymap();
if (!ephyrKeySyms.map) {
if (!ephyrKeySyms.minKeyCode) {
ErrorF("Couldn't load keymap from host\n");
return BadAlloc;
}

View File

@ -840,45 +840,14 @@ hostx_paint_debug_rect(struct EphyrHostScreen *host_screen,
void
hostx_load_keymap(void)
{
XID *keymap;
int host_width, min_keycode, max_keycode, width;
int i, j;
int min_keycode, max_keycode;
XDisplayKeycodes(HostX.dpy, &min_keycode, &max_keycode);
EPHYR_DBG("min: %d, max: %d", min_keycode, max_keycode);
keymap = XGetKeyboardMapping(HostX.dpy,
min_keycode,
max_keycode - min_keycode + 1, &host_width);
/* Try and copy the hosts keymap into our keymap to avoid loads
* of messing around.
*
* kdrive cannot can have more than 4 keysyms per keycode
* so we only copy at most the first 4 ( xorg has 6 per keycode, XVNC 2 )
*/
width = (host_width > 4) ? 4 : host_width;
ephyrKeySyms.map = (CARD32 *) calloc(sizeof(CARD32),
(max_keycode - min_keycode + 1) *
width);
if (!ephyrKeySyms.map)
goto out;
for (i = 0; i < (max_keycode - min_keycode + 1); i++)
for (j = 0; j < width; j++)
ephyrKeySyms.map[(i * width) + j] =
(CARD32) 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;
out:
XFree(keymap);
}
static struct EphyrHostScreen *

View File

@ -51,12 +51,9 @@ typedef enum EphyrHostXEventType {
EPHYR_EV_CONFIGURE,
} EphyrHostXEventType;
/* I can't believe it's not a KeySymsRec. */
typedef struct {
int minKeyCode;
int maxKeyCode;
int mapWidth;
CARD32 *map;
} EphyrKeySyms;
struct EphyrHostXEvent {