[PATCH xserver] fix a sign problem with valuator data.

Joe Shaw joe at joeshaw.org
Thu Oct 14 12:09:19 PDT 2010


Hi,

Here is a patch to fix problems with negative valuator values and
XQueryDeviceState().  Without this, joysticks and other devices
always return -2^31 with negative valuator values.

If changing DeviceEvent.valuators.data to a signed integer is
undesirable, another workable (but IMO grosser) fix is in
queryst.c:ProcXQueryDeviceState() changing this line:

*((int *)buf) = *values;

to:

*((int *)buf) = (int) (unsigned int) *values;

Thanks,
Joe



More information about the xorg-devel mailing list