Add support for per-axis valuator modes (Relative/Absolute)

The XI2 protocol supports per-axis modes, but the server so far does
not. This change adds support in the server.

A complication is the fact that XI1 does not support per-axis modes.
The solution provided here is to set a per-device mode that defines the
mode of at least the first two valuators (X and Y). Note that initializing
the first two axes to a different mode than the device mode will fail.

For XI1 events, any axes following the first two that have the same mode
will be sent to clients, up to the first axis that has a different mode.
Thus, if a device has relative, then absolute, then relative mode axes,
only the first block of relative axes will be sent over XI1.

Since the XI2 protocol supports per-axis modes, all axes are sent to the
client.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
Chase Douglas 2010-07-16 09:21:19 -04:00 committed by Peter Hutterer
commit 65c0fc81eb
12 changed files with 56 additions and 30 deletions

View file

@ -1127,7 +1127,7 @@ InitProximityClassDeviceStruct(DeviceIntPtr dev)
*/
void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int maxval,
int resolution, int min_res, int max_res)
int resolution, int min_res, int max_res, int mode)
{
AxisInfoPtr ax;
@ -1144,6 +1144,7 @@ InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, Atom label, int minval, int
ax->min_resolution = min_res;
ax->max_resolution = max_res;
ax->label = label;
ax->mode = mode;
}
static void