diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-22 16:11:24 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-10-22 16:19:00 +1000 |
commit | dd11f734a9a73bf34357c149d2809842938d57b5 (patch) | |
tree | f66e65c746b46a4993917776ca528d4a79b061a4 /Xi | |
parent | 5cf3b654fccf09de63a3f983c85096cda78fb693 (diff) |
input: remove "mode" field from ValuatorClassRec.
We have per-axis mode now. For those bits that still need it (XI 1.x),
assume that the first axis holds the device's 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 | 3 | ||||
-rw-r--r-- | Xi/listdev.c | 7 | ||||
-rw-r--r-- | Xi/queryst.c | 1 | ||||
-rw-r--r-- | Xi/setmode.c | 2 |
4 files changed, 7 insertions, 6 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 9bff2b3d5..d57265ede 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -556,7 +556,6 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) v->axisVal = (double*)(v->axes + from->valuator->numAxes); v->sourceid = from->id; - v->mode = from->valuator->mode; } else if (to->valuator && !from->valuator) { ClassesPtr classes; @@ -1177,7 +1176,7 @@ FixDeviceStateNotify(DeviceIntPtr dev, deviceStateNotify * ev, KeyClassPtr k, int nval = v->numAxes - first; ev->classes_reported |= (1 << ValuatorClass); - ev->classes_reported |= (dev->valuator->mode << ModeBitsShift); + ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift; ev->num_valuators = nval < 3 ? nval : 3; switch (ev->num_valuators) { case 3: diff --git a/Xi/listdev.c b/Xi/listdev.c index 3e5f3d9d2..2b2f294af 100644 --- a/Xi/listdev.c +++ b/Xi/listdev.c @@ -230,10 +230,11 @@ CopySwapKeyClass(ClientPtr client, KeyClassPtr k, char **buf) */ static int -CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) +CopySwapValuatorClass(ClientPtr client, DeviceIntPtr dev, char **buf) { int i, j, axes, t_axes; char n; + ValuatorClassPtr v = dev->valuator; xValuatorInfoPtr v2; AxisInfo *a; xAxisInfoPtr a2; @@ -247,7 +248,7 @@ CopySwapValuatorClass(ClientPtr client, ValuatorClassPtr v, char **buf) v2->class = ValuatorClass; v2->length = sizeof(xValuatorInfo) + t_axes * sizeof(xAxisInfo); v2->num_axes = t_axes; - v2->mode = v->mode & DeviceMode; + v2->mode = valuator_get_mode(dev, 0); v2->motion_buffer_size = v->numMotionEvents; if (client && client->swapped) { swapl(&v2->motion_buffer_size, n); @@ -286,7 +287,7 @@ CopySwapClasses(ClientPtr client, DeviceIntPtr dev, CARD8 *num_classes, } if (dev->valuator != NULL) { (*num_classes) += - CopySwapValuatorClass(client, dev->valuator, classbuf); + CopySwapValuatorClass(client, dev, classbuf); } } diff --git a/Xi/queryst.c b/Xi/queryst.c index 9c9e4e096..73af76d22 100644 --- a/Xi/queryst.c +++ b/Xi/queryst.c @@ -151,6 +151,7 @@ ProcXQueryDeviceState(ClientPtr client) tv->class = ValuatorClass; tv->length = sizeof(xValuatorState) + v->numAxes * 4; tv->num_valuators = v->numAxes; + tv->mode = valuator_get_mode(dev, 0); tv->mode |= (dev->proximity && !dev->proximity->in_proximity) ? OutOfProximity : 0; buf += sizeof(xValuatorState); for (i = 0, values = v->axisVal; i < v->numAxes; i++) { diff --git a/Xi/setmode.c b/Xi/setmode.c index ce2ad47c7..42e90f75d 100644 --- a/Xi/setmode.c +++ b/Xi/setmode.c @@ -110,7 +110,7 @@ ProcXSetDeviceMode(ClientPtr client) rep.status = SetDeviceMode(client, dev, stuff->mode); if (rep.status == Success) - dev->valuator->mode = stuff->mode; + valuator_set_mode(dev, VALUATOR_MODE_ALL_AXES, stuff->mode); else if (rep.status != AlreadyGrabbed) { switch(rep.status) { |