diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-03 17:04:54 +1030 |
commit | 8da83836b60f7cdb75d08482f4311fa0e2ab4e1d (patch) | |
tree | 092efcfc39e3e293baaf04c4c84027ee453d3e13 /xkb/xkbActions.c | |
parent | eace88989c3b65d5c20e9f37ea9b23c7c8e19335 (diff) | |
parent | ae869fc7669764729e13fdd70149ed636753f2a3 (diff) |
Merge branch 'master' into mpx
Conflicts:
XTrap/xtrapddmi.c
Xext/security.c
Xext/xprint.c
Xext/xtest.c
Xext/xvdisp.c
Xi/exevents.c
Xi/grabdevb.c
Xi/grabdevk.c
Xi/opendev.c
Xi/ungrdev.c
Xi/ungrdevb.c
Xi/ungrdevk.c
dix/cursor.c
dix/devices.c
dix/dixutils.c
dix/events.c
dix/getevents.c
dix/main.c
dix/window.c
hw/xfree86/ramdac/xf86Cursor.c
include/dix.h
include/input.h
include/inputstr.h
mi/midispcur.c
mi/miinitext.c
mi/misprite.c
render/animcur.c
xfixes/cursor.c
xkb/xkbAccessX.c
Diffstat (limited to 'xkb/xkbActions.c')
-rw-r--r-- | xkb/xkbActions.c | 42 |
1 files changed, 25 insertions, 17 deletions
diff --git a/xkb/xkbActions.c b/xkb/xkbActions.c index ebc5bfda7..00165be33 100644 --- a/xkb/xkbActions.c +++ b/xkb/xkbActions.c @@ -42,8 +42,7 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. #include <ctype.h> #define EXTENSION_EVENT_BASE 64 -static unsigned int _xkbServerGeneration; -int xkbDevicePrivateIndex = -1; +DevPrivateKey xkbDevicePrivateKey = &xkbDevicePrivateKey; void xkbUnwrapProc(DeviceIntPtr device, DeviceHandleProc proc, @@ -67,20 +66,12 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) { xkbDeviceInfoPtr xkbPrivPtr; - if (serverGeneration != _xkbServerGeneration) { - if ((xkbDevicePrivateIndex = AllocateDevicePrivateIndex()) == -1) - return; - _xkbServerGeneration = serverGeneration; - } - if (!AllocateDevicePrivate(device, xkbDevicePrivateIndex)) - return; - xkbPrivPtr = (xkbDeviceInfoPtr) xcalloc(1, sizeof(xkbDeviceInfoRec)); if (!xkbPrivPtr) return; xkbPrivPtr->unwrapProc = NULL; - device->devPrivates[xkbDevicePrivateIndex].ptr = xkbPrivPtr; + dixSetPrivate(&device->devPrivates, xkbDevicePrivateKey, xkbPrivPtr); WRAP_PROCESS_INPUT_PROC(device, xkbPrivPtr, proc, xkbUnwrapProc); } @@ -561,6 +552,9 @@ _XkbFilterPointerMove( XkbSrvInfoPtr xkbi, int x,y; Bool accel; + if (xkbi->device == inputInfo.keyboard) + return 0; + if (filter->keycode==0) { /* initial press */ filter->keycode = keycode; filter->active = 1; @@ -601,6 +595,9 @@ _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; @@ -972,8 +969,11 @@ _XkbFilterSwitchScreen( XkbSrvInfoPtr xkbi, unsigned keycode, XkbAction * pAction) { + DeviceIntPtr dev = xkbi->device; + if (dev == inputInfo.keyboard) + return 0; + if (filter->keycode==0) { /* initial press */ - DeviceIntPtr dev = xkbi->device; filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; @@ -995,8 +995,11 @@ _XkbFilterXF86Private( XkbSrvInfoPtr xkbi, unsigned keycode, XkbAction * pAction) { + DeviceIntPtr dev = xkbi->device; + if (dev == inputInfo.keyboard) + return 0; + if (filter->keycode==0) { /* initial press */ - DeviceIntPtr dev = xkbi->device; filter->keycode = keycode; filter->active = 1; filter->filterOthers = 0; @@ -1021,9 +1024,13 @@ _XkbFilterDeviceBtn( XkbSrvInfoPtr xkbi, DeviceIntPtr dev; int button; + if (dev == inputInfo.keyboard) + return 0; + if (filter->keycode==0) { /* initial press */ - dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL); - if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice())) + _XkbLookupButtonDevice(&dev, pAction->devbtn.device, serverClient, + DixUnknownAccess, &button); + if (!dev || !dev->public.on || dev == inputInfo.pointer) return 1; button= pAction->devbtn.button; @@ -1062,8 +1069,9 @@ int button; int button; filter->active= 0; - dev= _XkbLookupButtonDevice(filter->upAction.devbtn.device,NULL); - if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice())) + _XkbLookupButtonDevice(&dev, filter->upAction.devbtn.device, + serverClient, DixUnknownAccess, &button); + if (!dev || !dev->public.on || dev == inputInfo.pointer) return 1; button= filter->upAction.btn.button; |