diff options
author | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-07-25 19:39:46 +0000 |
commit | 4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (patch) | |
tree | c1e02b9d3509aa97703aa4b540d4cd22ec4600ed /xorg-server/xkb/xkbActions.c | |
parent | dc3c299dd0995549e2a6973ca0f25b254afd38a5 (diff) | |
download | vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.gz vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.tar.bz2 vcxsrv-4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05.zip |
Added xorg-server-1.6.2.tar.gz
Diffstat (limited to 'xorg-server/xkb/xkbActions.c')
-rw-r--r-- | xorg-server/xkb/xkbActions.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c index 8c72874df..aea479cd1 100644 --- a/xorg-server/xkb/xkbActions.c +++ b/xorg-server/xkb/xkbActions.c @@ -42,7 +42,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <ctype.h> #define EXTENSION_EVENT_BASE 64 -DevPrivateKey xkbDevicePrivateKey = &xkbDevicePrivateKey; +static int xkbDevicePrivateKeyIndex; +DevPrivateKey xkbDevicePrivateKey = &xkbDevicePrivateKeyIndex; void xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, @@ -594,9 +595,6 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi, unsigned keycode, XkbAction * pAction) { - if (xkbi->device == inputInfo.keyboard) - return 0; - if (filter->keycode==0) { /* initial press */ int button= pAction->btn.button; @@ -616,7 +614,7 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi, ((pAction->btn.flags&XkbSA_LockNoLock)==0)) { xkbi->lockedPtrButtons|= (1<<button); AccessXCancelRepeatKey(xkbi,keycode); - XkbDDXFakePointerButton(ButtonPress,button); + XkbDDXFakeDeviceButton(xkbi->device, 1, button); filter->upAction.type= XkbSA_NoAction; } break; @@ -627,12 +625,12 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi, if (pAction->btn.count>0) { nClicks= pAction->btn.count; for (i=0;i<nClicks;i++) { - XkbDDXFakePointerButton(ButtonPress,button); - XkbDDXFakePointerButton(ButtonRelease,button); + XkbDDXFakeDeviceButton(xkbi->device, 1, button); + XkbDDXFakeDeviceButton(xkbi->device, 0, button); } filter->upAction.type= XkbSA_NoAction; } - else XkbDDXFakePointerButton(ButtonPress,button); + else XkbDDXFakeDeviceButton(xkbi->device, 1, button); } break; case XkbSA_SetPtrDflt: @@ -688,7 +686,7 @@ _XkbFilterPointerBtn( XkbSrvInfoPtr xkbi, } xkbi->lockedPtrButtons&= ~(1<<button); case XkbSA_PtrBtn: - XkbDDXFakePointerButton(ButtonRelease,button); + XkbDDXFakeDeviceButton(xkbi->device, 0, button); break; } filter->active = 0; @@ -857,7 +855,7 @@ ProcessInputProc backupproc; if ((filter->keycode!=0)&&(filter->keycode!=keycode)) return 1; - GetSpritePosition(&x,&y); + GetSpritePosition(inputInfo.pointer, &x,&y); ev.u.keyButtonPointer.time = GetTimeInMillis(); ev.u.keyButtonPointer.rootX = x; ev.u.keyButtonPointer.rootY = y; @@ -902,10 +900,6 @@ ProcessInputProc backupproc; realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; - /* XXX: Bad! Since the switch to XI devices xkbi->device will be the - * XI device. Sending a core event through ProcessOtherEvent will - * cause trouble. Somebody should fix this. - */ UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, @@ -948,10 +942,6 @@ ProcessInputProc backupproc; realMods = xkbi->device->key->modifierMap[ev.u.u.detail]; xkbi->device->key->modifierMap[ev.u.u.detail] = 0; - /* XXX: Bad! Since the switch to XI devices xkbi->device will be the - * XI device. Sending a core event through ProcessOtherEvent will - * cause trouble. Somebody should fix this. - */ UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc); xkbi->device->public.processInputProc(&ev,xkbi->device,1); COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr, @@ -1031,7 +1021,7 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi, DeviceIntPtr dev; int button; - if (dev == inputInfo.keyboard) + if (xkbi->device == inputInfo.keyboard) return 0; if (filter->keycode==0) { /* initial press */ @@ -1053,7 +1043,7 @@ int button; switch (pAction->type) { case XkbSA_LockDeviceBtn: if ((pAction->devbtn.flags&XkbSA_LockNoLock)|| - (dev->button->down[button/8]&(1L<<(button%8)))) + BitIsOn(dev->button->down, button)) return 0; XkbDDXFakeDeviceButton(dev,True,button); filter->upAction.type= XkbSA_NoAction; @@ -1085,7 +1075,7 @@ int button; switch (filter->upAction.type) { case XkbSA_LockDeviceBtn: if ((filter->upAction.devbtn.flags&XkbSA_LockNoUnlock)|| - ((dev->button->down[button/8]&(1L<<(button%8)))==0)) + !BitIsOn(dev->button->down, button)) return 0; XkbDDXFakeDeviceButton(dev,False,button); break; @@ -1281,14 +1271,17 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev); } if (sendEvent) { + DeviceIntPtr tmpdev; if (keyEvent) { realMods = keyc->modifierMap[key]; keyc->modifierMap[key] = 0; - } + tmpdev = dev; + } else + tmpdev = GetPairedDevice(dev); - UNWRAP_PROCESS_INPUT_PROC(dev,xkbPrivPtr, backupproc); - dev->public.processInputProc(xE,dev,count); - COND_WRAP_PROCESS_INPUT_PROC(dev, xkbPrivPtr, + UNWRAP_PROCESS_INPUT_PROC(tmpdev,xkbPrivPtr, backupproc); + dev->public.processInputProc(xE,tmpdev,count); + COND_WRAP_PROCESS_INPUT_PROC(tmpdev, xkbPrivPtr, backupproc,xkbUnwrapProc); if (keyEvent) keyc->modifierMap[key] = realMods; |