XInput2: getting window-relative coordinates?

Peter Hutterer peter.hutterer at who-t.net
Sun Apr 19 04:19:56 PDT 2009


On Sun, Apr 19, 2009 at 01:14:57PM +0200, Simon Thum wrote:
> Peter Hutterer wrote:
>> On Sat, Apr 18, 2009 at 10:54:31AM +0200, Florian Echtler wrote:
>>>>> However, the second one (controlled by touchpad) reports values in the
>>>>> range (1472,1408) to (5472,4448). This is also reported in the Xorg.log
>>>>> by the synaptics driver. How can I map these to screen coordinates? As
>>>>> the pointer still moves in screen coordinates, the mapping must already
>>>>> exist somewhere, I assume.. I know that this is quite beta still, 
>>>>> so I'd be very grateful about some
>>>>> hints..
>>>> right, so the rule for coordinates is:
>>>> event_x,event_y, root_x, root_y are in absolute screen coordinates. or should
>>>> be anyway.
> Shouldn't event_[xy] be relative to the window? At least that's what I  
> understand from the xi2 protocol desc. If not, what's the difference  
> root<>event then?

relative to the window's origin but in the screen coordinate system.

so if the window is on  100/100, a device on root 101/101 has event 1/1,
even if the valuator state is e.g. 7202/2381 (valuators are in device
coordinates).

Cheers,
  Peter



More information about the xorg mailing list