[xserver][PATCH] Tablet to screen coordinate translation

Magnus Vigerlöf Magnus.Vigerlof at home.se
Sun Mar 4 10:04:26 PST 2007


On Sunday 04 March 2007 18:59, Magnus Vigerlöf wrote:
> On Sunday 04 March 2007 18:36, Daniel Stone wrote:
> [...]
>
> > > Ok, had to make some assumptions but here's a patch adding calls to the
> > > device-specific conversion routines defined in the LocalDeviceRec
> > > structure.
> > >
> > > This will make it possible to send extension events with the
> > > granulatity on x & y axis of the sending device while the core-events
> > > will be scaled to the screen resolution.
> >
> > NAK: The entire point of GPE is that it's a unified interface that
> > generates all events necessary (core, Xi, MPX).  IMO, the best idea
> > would be to send each event (or the list of events) back to the driver
> > for conversion.  After all, this is why GPE returns the events back to
> > the DDX, instead of enqueuing itself.
>
> Mmm... I split the GPE into two (extention and core) to cause minimal
> disturbances to the current code base and to be compatible with the current
> implementations of the other input devices, but I'll try to redo the patch
> according to these ideas instead.
>
> Question though: This means that we need a new method in the LocalDeviceRec
> structure or somwhere near to be called with the generated events for
> conversion. Is the struct above 'included' in the version defined by
> ABI_XINPUT_VERSION, or is there a better suited one that can be used? Also,
> should we remove the two conversion routines in that struct while we're at
> it if it's the one to make the change in?

On second thought... GPE moves the pointer on the screen.. This means that the 
device prior to calling xf86PostMotionEvent must scale x&y, and then re-scale 
the event for the extension event back to the 'real' values again when the 
callback comes.

Is this ok?

Cheers,
  Magnus V



More information about the xorg mailing list