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

Peter Hutterer mailinglists at who-t.net
Thu Mar 29 17:55:12 PDT 2007


On 30/03/2007, at 09:16 , Magnus Vigerlöf wrote:
> 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.

Oh. didn't know about that one.

> 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.

there's an important difference (at least in mpx): off_devices don't  
have sprites and thus aren't rendered. in fact, parts of the structs  
are uninitialised and if you would try to send events from an off  
device the server would give you a mass discount for segfaults. ATM,  
anything in off_devices can be ignored from the event delivery and  
cursor rendering side of things. checking each device for a on/off  
state would make code harder to read.

cpu time is cheap, especially if we only need to do it when devices  
are added/removed, which - presumably - doesn't happen too often.  
unless somebody cascades 100 devices up and then decides to plug/ 
unplug the main USB hub* we shouldn't have a problem with it.

*btw. doing so in windows xp makes windows play funny sounds for  
minutes at a time.

Cheers,
   Peter

--
Multi-Pointer X Server
htdtp://wearables.unisa.edu.au/mpx





More information about the xorg mailing list