[Mesa-dev] [PATCH 01/19] Xephyr: stop loading the host's keymap
Eric Anholt
eric at anholt.net
Mon Aug 26 11:16:37 PDT 2013
From: Julien Cristau <jcristau at debian.org>
This isn't used anywhere.
v2: Rebase to the top of the patch series (anholt)
Reviewed-by: Mikhail Gusarov <dottedmag at dottedmag.net> (v1)
Signed-off-by: Julien Cristau <jcristau at debian.org>
Signed-off-by: Eric Anholt <eric at anholt.net>
---
hw/kdrive/ephyr/ephyr.c | 2 +-
hw/kdrive/ephyr/hostx.c | 33 +--------------------------------
hw/kdrive/ephyr/hostx.h | 3 ---
3 files changed, 2 insertions(+), 36 deletions(-)
diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c
index 02d4970..b34b5cc 100644
--- a/hw/kdrive/ephyr/ephyr.c
+++ b/hw/kdrive/ephyr/ephyr.c
@@ -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;
}
diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c
index 5071289..f46770f 100644
--- a/hw/kdrive/ephyr/hostx.c
+++ b/hw/kdrive/ephyr/hostx.c
@@ -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 *
diff --git a/hw/kdrive/ephyr/hostx.h b/hw/kdrive/ephyr/hostx.h
index f47297c..f165606 100644
--- a/hw/kdrive/ephyr/hostx.h
+++ b/hw/kdrive/ephyr/hostx.h
@@ -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 {
--
1.8.4.rc3
More information about the mesa-dev
mailing list