summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorMagnus Vigerlöf <Magnus.Vigerlof@ipbo.se>2008-04-08 14:42:00 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-04-08 14:43:22 +0930
commit5ffbcfec3d37d3b627a78acfa00dbafc5948df82 (patch)
tree0405aa31a2aaad0002ec0444e6106cbf67d275d3 /dix
parent32e4a88ae613c7200d84d5621344b418b656346b (diff)
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>
Diffstat (limited to 'dix')
-rw-r--r--dix/events.c36
-rw-r--r--dix/getevents.c17
2 files changed, 36 insertions, 17 deletions
diff --git a/dix/events.c b/dix/events.c
index 6ecd90c08..42ae3f1cb 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -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,20 +3736,22 @@ DeliverGrabbedEvent(xEvent *xE, DeviceIntPtr thisDev,
{
core = *xE;
core.u.u.type = XItoCoreType(xE->u.u.type);
- FixUpEventFromWindow(thisDev, &core, grab->window,
- None, TRUE);
- if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
- grab->window, &core, 1) ||
- XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
- grab->window, &count, 1))
- deliveries = 1; /* don't send, but pretend we did */
- else if (!IsInterferingGrab(rClient(grab), thisDev,
- &core))
- {
- deliveries = TryClientEvents(rClient(grab), thisDev,
- &core, 1, mask,
- filters[thisDev->id][core.u.u.type],
- grab);
+ if(core.u.u.type) {
+ FixUpEventFromWindow(thisDev, &core, grab->window,
+ None, TRUE);
+ if (XaceHook(XACE_SEND_ACCESS, 0, thisDev,
+ grab->window, &core, 1) ||
+ XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
+ grab->window, &count, 1))
+ deliveries = 1; /* don't send, but pretend we did */
+ else if (!IsInterferingGrab(rClient(grab), thisDev,
+ &core))
+ {
+ deliveries = TryClientEvents(rClient(grab), thisDev,
+ &core, 1, mask,
+ filters[thisDev->id][core.u.u.type],
+ grab);
+ }
}
}
diff --git a/dix/getevents.c b/dix/getevents.c
index b73531816..037d68ceb 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -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;