Bug #3546: Use MAP_LENGTH instead of a magic number. (Mark McLoughlin) Bug

#3664: Further fixes to Xnest modifier state handling. (Mark
    McLoughlin)
This commit is contained in:
Adam Jackson 2005-07-02 17:02:23 +00:00
parent 9b1debcdb6
commit e6602b041f
2 changed files with 6 additions and 2 deletions

View File

@ -126,6 +126,7 @@ xnestCollectEvents()
break; break;
case ButtonPress: case ButtonPress:
xnestUpdateModifierState(X.xkey.state);
x.u.u.type = ButtonPress; x.u.u.type = ButtonPress;
x.u.u.detail = X.xbutton.button; x.u.u.detail = X.xbutton.button;
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();
@ -133,6 +134,7 @@ xnestCollectEvents()
break; break;
case ButtonRelease: case ButtonRelease:
xnestUpdateModifierState(X.xkey.state);
x.u.u.type = ButtonRelease; x.u.u.type = ButtonRelease;
x.u.u.detail = X.xbutton.button; x.u.u.detail = X.xbutton.button;
x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis(); x.u.keyButtonPointer.time = lastEventTime = GetTimeInMillis();

View File

@ -138,7 +138,7 @@ xnestKeyboardProc(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;
@ -168,7 +168,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
&mapWidth); &mapWidth);
#endif #endif
for (i = 0; i < 256; i++) for (i = 0; i < MAP_LENGTH; i++)
modmap[i] = 0; 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++) {
@ -294,6 +294,8 @@ xnestUpdateModifierState(unsigned int state)
int i; int i;
CARD8 mask; CARD8 mask;
state = state & 0xff;
if (keyc->state == state) if (keyc->state == state)
return; return;