diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-08-09 16:45:45 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-01-22 15:08:55 +1100 |
commit | 6727ee94086d238f9f99379280d4e4827f388cce (patch) | |
tree | cdd241f77a324e83c630fe847036b3ecae344e4e /xkb | |
parent | 08363c5830bdea34012dcd954b45ccfdc79a3a7e (diff) |
Input: Remove state from KeyClassRec
We already have state fully stored within XKB, so instead of duplicating it,
just generate the values to send to clients when required.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'xkb')
-rw-r--r-- | xkb/xkb.c | 3 | ||||
-rw-r--r-- | xkb/xkbAccessX.c | 1 | ||||
-rw-r--r-- | xkb/xkbActions.c | 22 |
3 files changed, 4 insertions, 22 deletions
@@ -559,7 +559,7 @@ ProcXkbGetState(ClientPtr client) rep.sequenceNumber= client->sequence; rep.length = 0; rep.deviceID = dev->id; - rep.mods = dev->key->state&0xff; + rep.mods = XkbStateFieldFromRec(xkb) & 0xff; rep.baseMods = xkb->base_mods; rep.lockedMods = xkb->locked_mods; rep.latchedMods = xkb->latched_mods; @@ -626,7 +626,6 @@ ProcXkbLatchLockState(ClientPtr client) return status; XkbComputeDerivedState(tmpd->key->xkbInfo); - tmpd->key->state = XkbStateFieldFromRec(newState); changed = XkbStateChangedFlags(&oldState, newState); if (changed) { diff --git a/xkb/xkbAccessX.c b/xkb/xkbAccessX.c index 85d409650..b98b0d854 100644 --- a/xkb/xkbAccessX.c +++ b/xkb/xkbAccessX.c @@ -748,7 +748,6 @@ deviceKeyButtonPointer *kbp = xE; XkbUpdateIndicators(dev,changed_leds,True,NULL,&cause); } } - dev->key->state= XkbStateFieldFromRec(&xkbi->state); } if (((xkbi->flags&_XkbStateNotifyInProgress)==0)&&(changed!=0)) { diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index 315ff0db7..272a7854e 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -802,7 +802,7 @@ unsigned realMods = 0; xEvent ev; int x,y; XkbStateRec old; -unsigned mods,mask,oldCoreState = 0,oldCorePrevState = 0; +unsigned mods,mask; xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(xkbi->device); ProcessInputProc backupproc; @@ -843,8 +843,6 @@ ProcessInputProc backupproc; if ( mask || mods ) { old= xkbi->state; - oldCoreState= xkbi->device->key->state; - oldCorePrevState= xkbi->device->key->prev_state; xkbi->state.base_mods&= ~mask; xkbi->state.base_mods|= (mods&mask); xkbi->state.latched_mods&= ~mask; @@ -852,8 +850,6 @@ ProcessInputProc backupproc; xkbi->state.locked_mods&= ~mask; xkbi->state.locked_mods|= (mods&mask); XkbComputeDerivedState(xkbi); - xkbi->device->key->state= xkbi->device->key->prev_state= - xkbi->state.mods; } realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; @@ -864,11 +860,8 @@ ProcessInputProc backupproc; backupproc,xkbUnwrapProc); xkbi->device->key->modifierMap[ev.u.u.detail] = realMods; - if ( mask || mods ) { - xkbi->device->key->state= oldCoreState; - xkbi->device->key->prev_state= oldCorePrevState; + if ( mask || mods ) xkbi->state= old; - } } else if (filter->keycode==keycode) { @@ -885,8 +878,6 @@ ProcessInputProc backupproc; if ( mask || mods ) { old= xkbi->state; - oldCoreState= xkbi->device->key->state; - oldCorePrevState= xkbi->device->key->prev_state; xkbi->state.base_mods&= ~mask; xkbi->state.base_mods|= (mods&mask); xkbi->state.latched_mods&= ~mask; @@ -894,8 +885,6 @@ ProcessInputProc backupproc; xkbi->state.locked_mods&= ~mask; xkbi->state.locked_mods|= (mods&mask); XkbComputeDerivedState(xkbi); - xkbi->device->key->state= xkbi->device->key->prev_state= - xkbi->state.mods; } realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; @@ -906,11 +895,8 @@ ProcessInputProc backupproc; backupproc,xkbUnwrapProc); xkbi->device->key->modifierMap[ev.u.u.detail] = realMods; - if ( mask || mods ) { - xkbi->device->key->state= oldCoreState; - xkbi->device->key->prev_state= oldCorePrevState; + if ( mask || mods ) xkbi->state= old; - } filter->keycode= 0; filter->active= 0; @@ -1250,8 +1236,6 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); xkbi->prev_state= oldState; XkbComputeDerivedState(xkbi); - keyc->prev_state= keyc->state; - keyc->state= XkbStateFieldFromRec(&xkbi->state); changed = XkbStateChangedFlags(&oldState,&xkbi->state); if (genStateNotify) { if (changed) { |