[PATCH] dix: report XI1 axis values correctly if first_valuator != 0

Thomas Jaeger thjaeger at gmail.com
Tue Sep 22 22:36:54 PDT 2009

Peter Hutterer wrote:
> 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:
>>> - 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

I might have been to vague about what the actual issue is.  The recent
change in evdev (part of 1f641d75) means that gtk's extended input
events (the code currently assumes that first_valuator == 0) are broken
for any device using the evdev driver.  I see two short-term solutions:

(a) Make evdev always report at least the first two valuators (or even
all of them).

(b) As part of the effort of making XInput events work with the latest
gtk+ version again[1], go all out in gtk+ by always selecting for all
MotionNotify and DeviceState events and then doing the necessary

The problem with (a) is that we already have released versions of evdev
that send events that probably no existing client can handle.  On the
other hand, I don't know how realistic it would be for (b) to land
before 2.18.

As for a long-time solution, I even less of a clue what to do.  If we
make the assumption that any client that cares about valuators will
select for Motion events, an XI1-style DeviceState event might do the trick.


[1] https://bugzilla.gnome.org/show_bug.cgi?id=588649

More information about the xorg-devel mailing list