Commit 7a627e64 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Some small Keyboard.c improvements

as in xorg-xserver upstream's hw/xnest/Keyboard.c
parent 98349512
...@@ -704,7 +704,7 @@ int nxagentKeyboardProc(DeviceIntPtr pDev, int onoff) ...@@ -704,7 +704,7 @@ int nxagentKeyboardProc(DeviceIntPtr pDev, int onoff)
int mapWidth; int mapWidth;
int min_keycode, max_keycode; int min_keycode, max_keycode;
KeySymsRec keySyms; KeySymsRec keySyms;
CARD8 modmap[256]; CARD8 modmap[MAP_LENGTH];
int i, j; int i, j;
XKeyboardState values; XKeyboardState values;
char *model = NULL, *layout = NULL; char *model = NULL, *layout = NULL;
...@@ -765,7 +765,7 @@ N/A ...@@ -765,7 +765,7 @@ N/A
#ifdef _XSERVER64 #ifdef _XSERVER64
{ {
KeySym64 *keymap64; KeySym64 *keymap64;
int i, len; int len;
keymap64 = XGetKeyboardMapping(nxagentDisplay, keymap64 = XGetKeyboardMapping(nxagentDisplay,
min_keycode, min_keycode,
max_keycode - min_keycode + 1, max_keycode - min_keycode + 1,
...@@ -807,8 +807,7 @@ N/A ...@@ -807,8 +807,7 @@ N/A
nxagentCapsMask = 0; nxagentCapsMask = 0;
nxagentNumlockMask = 0; nxagentNumlockMask = 0;
for (i = 0; i < 256; i++) memset(modmap, 0, sizeof(modmap));
modmap[i] = 0;
for (j = 0; j < 8; j++) for (j = 0; j < 8; j++)
for(i = 0; i < modifier_keymap->max_keypermod; i++) { for(i = 0; i < modifier_keymap->max_keypermod; i++) {
CARD8 keycode; CARD8 keycode;
...@@ -823,6 +822,7 @@ N/A ...@@ -823,6 +822,7 @@ N/A
} }
} }
XFreeModifiermap(modifier_keymap); XFreeModifiermap(modifier_keymap);
modifier_keymap = NULL;
nxagentCheckRemoteKeycodes(); nxagentCheckRemoteKeycodes();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment