dix: Ensure Proximity events don't kill the server.
Add Prox events to the if-clauses with the other events that are usually sent from the input devices. Ensure that the event deliverers won't try to deliver events of type '0' (some extended events doesn't have an equivalent core-type) Small modification by Peter Hutterer. Signed-off-by: Peter Hutterer <peter@cs.unisa.edu.au>
This commit is contained in:
parent
32e4a88ae6
commit
5ffbcfec3d
|
@ -2513,7 +2513,7 @@ DeliverDeviceEvents(WindowPtr pWin, xEvent *xE, GrabPtr grab,
|
|||
core = *xE;
|
||||
core.u.u.type = XItoCoreType(xE->u.u.type);
|
||||
|
||||
if (filter & pWin->deliverableEvents)
|
||||
if (core.u.u.type && filter & pWin->deliverableEvents)
|
||||
{
|
||||
if ((wOtherEventMasks(pWin)|pWin->eventMask) & filter)
|
||||
{
|
||||
|
@ -3562,6 +3562,8 @@ CheckDeviceGrabs(DeviceIntPtr device, xEvent *xE,
|
|||
{
|
||||
core = *xE;
|
||||
core.u.u.type = XItoCoreType(xE->u.u.type);
|
||||
if(!core.u.u.type) /* probably a Proximity event, can't grab for those */
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
i = checkFirst;
|
||||
|
@ -3651,7 +3653,7 @@ DeliverFocusedEvent(DeviceIntPtr keybd, xEvent *xE, WindowPtr window, int count)
|
|||
if (deliveries > 0)
|
||||
return;
|
||||
|
||||
if (sendCore)
|
||||
if (sendCore && core.u.u.type)
|
||||
{
|
||||
FixUpEventFromWindow(keybd, &core, focus, None, FALSE);
|
||||
deliveries = DeliverEventsToWindow(keybd, focus, &core, 1,
|
||||
|
@ -3734,6 +3736,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
|
|||
{
|
||||
core = *xE;
|
||||
core.u.u.type = XItoCoreType(xE->u.u.type);
|
||||
if(core.u.u.type) {
|
||||
FixUpEventFromWindow(thisDev, &core, grab->window,
|
||||
None, TRUE);
|
||||
if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
|
||||
|
@ -3750,6 +3753,7 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
|
|||
grab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!deliveries)
|
||||
{
|
||||
|
|
|
@ -816,7 +816,8 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
|
|||
int first_valuator, int num_valuators, int *valuators)
|
||||
{
|
||||
int num_events = 1;
|
||||
deviceKeyButtonPointer *kbp = (deviceKeyButtonPointer *) events->event;
|
||||
deviceKeyButtonPointer *kbp;
|
||||
DeviceIntPtr master;
|
||||
|
||||
/* Sanity checks. */
|
||||
if (type != ProximityIn && type != ProximityOut)
|
||||
|
@ -840,6 +841,20 @@ GetProximityEvents(EventList *events, DeviceIntPtr pDev, int type,
|
|||
(num_valuators + first_valuator) > pDev->valuator->numAxes)
|
||||
return 0;
|
||||
|
||||
master = pDev->u.master;
|
||||
if (master && master->u.lastSlave != pDev)
|
||||
{
|
||||
CreateClassesChangedEvent(events, master, pDev);
|
||||
|
||||
pDev->lastx = master->lastx;
|
||||
pDev->lasty = master->lasty;
|
||||
master->u.lastSlave = pDev;
|
||||
|
||||
num_events++;
|
||||
events++;
|
||||
}
|
||||
|
||||
kbp = (deviceKeyButtonPointer *) events->event;
|
||||
kbp->type = type;
|
||||
kbp->deviceid = pDev->id;
|
||||
kbp->detail = 0;
|
||||
|
|
|
@ -239,7 +239,8 @@ ChangeDeviceID(DeviceIntPtr dev, xEvent* event)
|
|||
|
||||
if (type == DeviceKeyPress || type == DeviceKeyRelease ||
|
||||
type == DeviceButtonPress || type == DeviceButtonRelease ||
|
||||
type == DeviceMotionNotify)
|
||||
type == DeviceMotionNotify || type == ProximityIn ||
|
||||
type == ProximityOut)
|
||||
((deviceKeyButtonPointer*)event)->deviceid = dev->id;
|
||||
else if (type == DeviceValuator)
|
||||
((deviceValuator*)event)->deviceid = dev->id;
|
||||
|
|
Loading…
Reference in New Issue