[PATCH 6/6] xserver: input device id counter fix

Magnus Vigerlöf Magnus.Vigerlof at home.se
Thu Mar 29 16:46:38 PDT 2007


On Thursday 29 March 2007 04:01, Peter Hutterer wrote:
[...]
> if you keep the inputInfo.devices list sorted, you won't need the
> inputDeviceArray and we don't have to worry about keeping the array
> synchronised with the list.
>
> Cheers,
>    Peter

There are three list of input devices available:

xf86InputDevs: All devices with and without device id. New devices are added 
to the beginning of the list.

inputInfo.devices: All devices which has a successfully called DEVICE_ON are 
here. New devices are added to the end of the list.

inputInfo.off_devices: All new devices that not yet has been called DEVICE_ON 
for or those that this function failed. Or all those that has been called 
DEVICE_OFF. New/old devices are added to the end of the list.


Sorting the last two lists wouldn't be a big thing I guess, but since there 
might be devices in both lists we would need to iterate both lists at the 
same time if we should find the next id effectively, or we could eliminate 
one of the lists and use a variable in the structure to define if it's ON or 
OFF.

You think my patch is a cop-out? Oh yes, I agree.. But I made the array at 
least static so it can't be used outside the file :) I'm no stranger for an 
patch that do the above stuff..

Thanks!
 Magnus V



More information about the xorg mailing list