diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-22 15:49:40 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-22 16:18:59 +1000 |
commit | 5cf3b654fccf09de63a3f983c85096cda78fb693 (patch) | |
tree | 52499ca647f1dc3fb510df4efdd017fbe0580972 /Xi | |
parent | e909af88bf17dbadcc00d50c13a5bdb6001367be (diff) |
input: move proximity state into ProximityClassRec.
Previously the OutOfProximity bit in the valuator mode.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 8 | ||||
-rw-r--r-- | Xi/queryst.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 1f59001cf..9bff2b3d5 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -891,9 +891,9 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) mask = PointerMotionMask | b->state | b->motionMask; SetMaskForEvent(device->id, mask, MotionNotify); } else if (event->type == ET_ProximityIn) - device->valuator->mode &= ~OutOfProximity; + device->proximity->in_proximity = TRUE; else if (event->type == ET_ProximityOut) - device->valuator->mode |= OutOfProximity; + device->proximity->in_proximity = FALSE; return DEFAULT; } @@ -1112,6 +1112,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev) if (!proxc) return FALSE; proxc->sourceid = dev->id; + proxc->in_proximity = TRUE; dev->proximity = proxc; return TRUE; } @@ -1145,6 +1146,9 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int ax->max_resolution = max_res; ax->label = label; ax->mode = mode; + + if (mode & OutOfProximity) + dev->proximity->in_proximity = FALSE; } static void diff --git a/Xi/queryst.c b/Xi/queryst.c index 65a43d1d2..9c9e4e096 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -151,7 +151,7 @@ ProcXQueryDeviceState(ClientPtr client) tv->class = ValuatorClass; tv->length = sizeof(xValuatorState) + v->numAxes * 4; tv->num_valuators = v->numAxes; - tv->mode = v->mode; + tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0; buf += sizeof(xValuatorState); for (i = 0, values = v->axisVal; i < v->numAxes; i++) { if (rc != BadAccess) |