aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/xkb/xkbActions.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
committermarha <marha@users.sourceforge.net>2009-07-25 20:12:58 +0000
commit2553bdd7c359cd87525d367761c86932cec5adff (patch)
treeae71245933c98474a699d3e392de5820879b2018 /xorg-server/xkb/xkbActions.c
parente2c51f2ee7b0a3ea1a052fc49324057b4a4bbc78 (diff)
parent4a3dbb926ae3f5410198d7cc4f4ebe4f62eebf05 (diff)
downloadvcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.gz
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.tar.bz2
vcxsrv-2553bdd7c359cd87525d367761c86932cec5adff.zip
svn merge file:///D:/svnrepos/vcxsrv/branches/released .
Diffstat (limited to 'xorg-server/xkb/xkbActions.c')
-rw-r--r--xorg-server/xkb/xkbActions.c43
1 files changed, 18 insertions, 25 deletions
diff --git a/xorg-server/xkb/xkbActions.c b/xorg-server/xkb/xkbActions.c
index 0b7e03032..d50334999 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,
@@ -1037,7 +1027,7 @@ int button;
if (!dev || !dev->public.on || dev == inputInfo.pointer)
return 1;
- if (dev == inputInfo.keyboard)
+ if (xkbi->device == inputInfo.keyboard)
return 0;
button= pAction->devbtn.button;
@@ -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;