Input device design (3)
jg at freedesktop.org
Fri Sep 2 08:05:01 PDT 2005
On Fri, 2005-09-02 at 15:17 +0200, Waldo Bastian wrote:
> On Wednesday 31 August 2005 19:16, Jim Gettys wrote:
> > On Wed, 2005-08-31 at 02:56 -0400, James Cloos wrote:
> > > BTW, just to be clear, I (at least) wasn't thinking of having the
> > > actual i/o events go through this os-dependant, external server,
> > > but rather just the initial discovery and hotplugging of i/o devices.
> > >
> > > I was expecting the external server to notify the X server of the
> > > locations of the devices. Ie, on Linux it could tell the X server
> > > that /dev/input/event5 just appeared, is a pointer, and should join
> > > the set of core pointers. Or that eg /dev/input/event2 went away
> > > and should be close(2)ed. Et cetera.
> > Exactly, though I think the X server can find out itself when devices go
> > away: it will get an error on the file descriptor, so it isn't clear a
> > close message is needed (unless we want to be able to take away a device
> > already assigned to the X server... Hmmm...)
> > Do people think we need to be able to retrieve input devices once
> > assigned to the X server.
> For completeness I would add it.
> A more interesting problem is how such disappearing devices should be handled
> at the X Client side. Should they removed from XListInputDevices? (I think
> so) What about X clients that have the device open with XOpenDevice? Should
> device ID's be reused?
The question is whether we want running applications to break when input
devices evaporate under them. In this case, the application gets errors
it isn't expecting, and probably dies.
Another strategy is to have the device just go "idle", and requests to
manipulate it get ignored. If the same device gets plugged in again
(which begs an interesting question about whether we can find out or
guess it is the same device), things might continue where it left off,
using the same device ID. I don't think device ID's should get reused
any sooner than necessary, unless we believe it is for the same device.
This has some attractive robustness properties.
I think it must be possible for clients to track the coming and going of
devices, if they are interested. We'll have to add to the extension a
bit to make this possible.
More information about the xorg