XQuartz tablet mouse events are at the wrong location and other Xinput headaches

Jeremy Huddleston jeremyhu at apple.com
Wed Mar 21 00:23:52 PDT 2012


On Mar 20, 2012, at 8:07 PM, Peter Hutterer <peter.hutterer at who-t.net> wrote:

> On Sat, Mar 17, 2012 at 12:49:53AM -0700, Jeremy Huddleston wrote:
>> 
>> Here are some examples.  The first is just valuator_mask_get_double(..., #) for the valuators of the event we enqueue with QueuePointerEvents(pDev, ev_type, ev_button, POINTER_ABSOLUTE, &valuators).  The second is from the corresponding event sent to 'xinput test pointer'.
>> 
>> Valuators: {32777.666667,0.000000,0.000000,22526.687460,0.000000}
>> motion a[0]=16398 a[1]=0 a[2]=0 a[3]=22526 a[4]=0
>> 
>> Valuators: {32777.666667,65510.186667,0.000000,-23552.718772,-12288.375011}
>> motion a[0]=16398 a[1]=65510 a[2]=0 a[3]=-23552 a[4]=-12288
>> 
>> Valuators: {65526.266667,21.333333,0.000000,39935.218726,3070.093692}
>> motion a[0]=65521 a[1]=21 a[2]=0 a[3]=39935 a[4]=3070 
>> 
>> Valuators: {65526.266667,65471.360000,0.000000,61439.874996,-21504.656270}
>> motion a[0]=65521 a[1]=65471 a[2]=0 a[3]=61439 a[4]=-21504
> 
> I just tried this with a uinput test device that submits exactly the same
> values and has the same button/axes as the darwinTablet (had to set
> BTN_STYLUS to avoid evdev treating it as touchpad but that does not
> affect any coordinate handling in the server).
> The coordinates are identical, so I'm a bit confused where the scaling comes
> from. I noticed that the debug output displays pointer_x, pointer_y, but not
> the valuators[] values you actually submit to the dix. 

The copy/pasted text above actually *are* the valuators sent to the dix.  The debug printing does include pointer_x and pointer_y, but I omitted those in the information above.  From darwinEvents.c[1], you can see the Valuators above match what we're sending to QueuePointerEvents:

    DEBUG_LOG("Pointer (%lf, %lf), Valuators: {%lf,%lf,%lf,%lf,%lf}\n", pointer_x, pointer_y,
              valuator_mask_get_double(pmask, 0), valuator_mask_get_double(pmask, 1),
              valuator_mask_get_double(pmask, 2), valuator_mask_get_double(pmask, 3),
              valuator_mask_get_double(pmask, 4));
    }

1: http://cgit.freedesktop.org/~jeremyhu/xserver/tree/hw/xquartz/darwinEvents.c?h=server-1.13-apple&id=5adf599c893e68a3057a6c4af507e4275dc6fca5

> I'd prefer to see those too, to rule out that there's some scaling issue
> before QueuePointerEvents.

Yeah, that was essentially what I did =/

> Do you have anything that sets the coordinate transformation matrix?

We should have it set to unity by our call to AddInputDevice().  I'll check that explicitly when I get back home later this week and have access to a tablet again.

> Do you have more than one ScreenRec?

No.




More information about the xorg-devel mailing list