Smooth scrolling again

Peter Hutterer peter.hutterer at who-t.net
Sun Nov 14 13:52:31 PST 2010


On Sun, Nov 14, 2010 at 06:51:43PM +0100, Max Schwarz wrote:
> Hi Simon,
> 
> > > The clients depend on XIDeviceChangedEvents anyway to acquire the new
> > > resolution when the user switches input devices (see pscrolltest.c).
> > 
> > Though that sounds fine, I think the event is intended for master/slave
> > issues. That's deep in spec land, however. Read up and see if it fits.
> From the spec:
> 
> -- A DeviceChangeEvent is sent whenever a device changes it's capabilities.
> -- This can happen either by a new slave device sending events through a
> -- master device, or by a physical device changing capabilities at runtime.
> 
> Seems fine to me. New Slave = User switched input devices,
> Capabilities = Changed resolution.
> To the client it's the same thing anyway, it needs to check wether the new 
> device supports pscroll and get the changed resolution.

correct, the XIDeviceChangedEvents is the event to send to the clients in
this case. however, atm we don't have any hooks in the input driver API that
change the capabilities of the device and generate the event, so this needs
to be added.

One simple option would be to add the event generation hooks to
InitValuatorAxisStruct and similar calls. The main problem here is that
(strictly speaking) once you change capabilities at runtime, you need to
send XI 1.4 DevicePresence events to all XI 1.4 clients to fake device
removal and re-addition. otherwise, if you change the axis ranges these
clients may not be aware of it.

as for XI 1.3 clients that don't support DevicePresence events, well, you've
already lost :)

> > > Are the drivers "allowed" to access the valuator structure
> > > (e.g. dev->valuator->axis[0].resolution = XY) or should I implement
> > > wrapper functions in the server to do that?
> > 
> > It depends on whether the server can operate properly without wrappers,
> > i.e. whether some complex state needs wrangling. In that particular
> > case, I'm leaning slightly towards wrapping.
> That would mean something like
> xf86SetValuatorAxisResolution(DeviceIntPtr dev, int axnum, int min, int max, 
> int current)?
> This method could directly send out the DeviceChangedEvent. Would that still 
> be a layer violation?
> I'll add that to my patch in the next days.

if possible, wrap it. it's much easier to work around issues than when each
driver just mangles the struct directly. But I don't think you need a new
call here, just re-using the existing InitValuatorAxisStruct should do.

Cheers,
  Peter



More information about the xorg-devel mailing list