[PATCH] dix: report XI1 axis values correctly if first_valuator != 0
peter.hutterer at who-t.net
Tue Sep 22 20:18:34 PDT 2009
On Tue, Sep 22, 2009 at 10:02:08PM -0400, Thomas Jaeger wrote:
> Peter Hutterer wrote:
> > On Tue, Sep 22, 2009 at 09:12:01PM -0400, Thomas Jaeger wrote:
> >> This raises an interesting question, though: How are applications
> >> supposed to keep track of the valuators they're interested in if events
> >> only contain partial valuator information? XI1 clients can select for
> >> DeviceState and all Motion events to ensure they are always aware of the
> >> valuator state, which seems a little wasteful but at least it'll work.
> >> I see no way for XI2 clients to accomplish the same thing.
> > I hope I understand this correctly:
> > The mask in each event specifies which valuators are set.
> > - for relative axes, there's no "keeping track" anyway. So the first event
> > that has the matching valuator set matters.
> This is fine.
> > - for absolute axes, you get the initial state from the XIQueryDevice call
> > and then subsequent values through the events. if an event never contains
> > the valuator you need, it's value is unchanged from the original one.
> This is the problematic case. If the pointer is outside your
> application's window, you won't get any motion events at all, so the
> valuator might change without you knowing. Event if the pointer stays
> inside the application window all the time, you might not have selected
> for all motion events, but only for ButtonMotion (XI1 or XI2 grabs) or
> only for Press/Release events.
I do not have a solution for you other than polling with XIQueryDevice,
sorry. Please add this as a missing feature to http://wiki.x.org/wiki/XI2
More information about the xorg-devel