[Xorg] Input device hotplug

Kristian Høgsberg krh at bitplanet.net
Sat Jul 3 08:52:24 PDT 2004


Egbert Eich wrote:
> Kristian Høgsberg writes:
>  > Egbert Eich wrote:
>  > > Keith Packard writes:
>  > >  > 
>  > >  > Around 19 o'clock on Jun 23, =?ISO-8859-1?Q?Kristian_H=F8gsberg?= wrote:
>  > >  > 
>  > >  > > The overall design I'm thinking of is to keep the device discovery 
>  > >  > > mechanism out of the X server.
>  > >  > 
>  > >  > I think that's probably the right design.
>  > > 
>  > > Provided it is generic and not X specific. 
>  > 
>  > The main idea behind keeping the discovery mechanism out of the server 
>  > was that different systems can use different mechanisms.  On GNOME or 
>  > KDE desktops I think it would make good sense to use HAL for detection 
>  > (which is generic and system-wide), but an embedded system may well want 
>  > to use something more lean.
> 
> It depends on if you want to implement different system specific mechanisms
> into the clients by adding them to the toolkits or if you want to abstract
> away things from the clients (and the toolkits) by putting the system
> dependent  functionality into one central place (the Xserver) which exposes
> a uniform interface to its clients.

It wasn't my intention that all clients should use the hotplug requests, 
only the input device hotplug daemon.  Toolkit support should not be 
necessary either, you would use the XInput Xlib API directly.   This way 
you still have system dependent functionality in one central place, it's 
just not in the X server but in the hotplug daemon.

...

> What I remember right now:
> 1.a. Clearify meaning of device type and device name in the XDeviceInfo 
>      struct. Type is an Atom form a fixed list. 
>   b. A device type touchpad is meaningless as it doesn't describe what 
>      device (stylus, eraser, mouse etc.) is attached.

Yeah, this bit from xf86Xinput.c:xf86ActivateDevice() doesn't help:

	local->atom = MakeAtom(local->name,
			       strlen(local->name),
			       TRUE);
	AssignTypeAndName (dev, local->atom, local->name);

i.e. it creates a atom for the device name and uses it as the type :-/. 
  Here's output from a modified xsetpointer -l:

"Mouse0"        XID=3, type=Mouse0 (115) [XPointer]
"keyboard"      XID=4, type=NULL (0) [XKeyboard]
"stylus"        XID=2, type=stylus (114) [XExtensionDevice]
"eraser"        XID=1, type=eraser (113) [XExtensionDevice]
"cursor"        XID=0, type=cursor (112) [XExtensionDevice]

> 2. Make device controls more flexible. A device control currently 
>    is an XID. Make it an Atom.

Can this be done in a backward compatible way or would we need a new 
request?  Btw, why is the device control both in the 
XChangeDeviceControl() argument list and in the XDeviceControl struct? 
That's redundant...

Kristian




More information about the xorg mailing list