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/ddxDevBtn.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/ddxDevBtn.c')
-rw-r--r-- | xorg-server/xkb/ddxDevBtn.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/xorg-server/xkb/ddxDevBtn.c b/xorg-server/xkb/ddxDevBtn.c index 5313a1ec5..44ee75f5d 100644 --- a/xorg-server/xkb/ddxDevBtn.c +++ b/xorg-server/xkb/ddxDevBtn.c @@ -42,6 +42,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. extern int DeviceValuator; +static EventListPtr masterEvents = NULL; + void XkbDDXFakeDeviceButton(DeviceIntPtr dev,Bool press,int button) { @@ -52,6 +54,7 @@ deviceKeyButtonPointer *btn; deviceValuator * val; int x,y; int nAxes, i, count; +DeviceIntPtr master = NULL; if (dev == inputInfo.pointer || !dev->public.on) return; @@ -60,7 +63,7 @@ int nAxes, i, count; if (nAxes > 6) nAxes = 6; - GetSpritePosition(&x,&y); + GetSpritePosition(dev, &x,&y); btn= (deviceKeyButtonPointer *) &events[0]; val= (deviceValuator *) &events[1]; if (press) btn->type= DeviceButtonPress; @@ -95,6 +98,32 @@ int nAxes, i, count; count= 1+((nAxes+5)/6); } + /* XXX: This is obnoxious. ProcessOtherEvent updates the DIX device state, + * but may not do anything if the device state is invalid. This happens if + * we post a mouse event from a pure keyboard device. So we need to hack + * around that by getting the master, then posting the event for the + * pointer paired with the master. + * + * Note:the DeviceButtonEvent on the SD itself will do nothing in most + * cases, unless dev is both a keyboard and a mouse. + */ + if (!dev->isMaster && dev->u.master) { + if (!masterEvents) + { + masterEvents = InitEventList(1); + SetMinimumEventSize(masterEvents, 1, (1 + MAX_VALUATOR_EVENTS) * sizeof(xEvent)); + } + master = dev->u.master; + if (!IsPointerDevice(master)) + master = GetPairedDevice(dev->u.master); + + CopyGetMasterEvent(master, dev, &events, masterEvents, count); + } + (*dev->public.processInputProc)((xEventPtr)btn, dev, count); + + if (master) { + (*master->public.processInputProc)(masterEvents->event, master, count); + } return; } |