Commit graph

320 commits

Author SHA1 Message Date
Peter Hutterer
c9c4e13e8a inputproto 2.1.99.2
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-11-11 14:22:08 +10:00
Peter Hutterer
b289b1c039 XI2: Use touchid, not touch_id in XIAllowEvents
Be consistent with other usages of touchid.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-04 07:41:31 +10:00
Peter Hutterer
86ce2d05e8 XI2: swap (Raw)TouchUpdate and (Raw)TouchEnd
Not having the event codes in the order begin/update/end does my head in
when debugging. It also means there's no symmetry between raw and normal
touch events as the ownership event is wedged in between.
Rearrange event codes to be Begin/Update/End for both, with the
OwnershipEvent being in between.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-11-03 10:43:24 -04:00
Chase Douglas
cec7567863 Revert addition of active_touches to device events
I can't remember why it's there, and I don't see how it may be useful.
If a client really wants to know how many touches are on the device,
they can listen to raw events and count the number of active touches.

(Real reason: extending events is hard :)

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-16 11:47:38 -07:00
Chase Douglas
22c06a5ddb Fix Xi 2.x version comment in XI2.h
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-14 20:15:49 -05:00
Chase Douglas
88410aa51d inputproto 2.1.99.1 (first snapshot of 2.2)
Note that this is built on top of 2.0.99.1, which is a development
snapshot of 2.1.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-14 15:21:49 -05:00
Chase Douglas
fa16231f0e Allow grabbing clients to accept or reject touches any time
This is potentially both a performance and client complexity
improvement. An example is a gesture recognizer using touch grabs on
each window with a subscription. If events on a child window are known
to not match any subscription on the child window, then the client
should be able to reject the touch grab even if the parent window hasn't
accepted any of the touches, perhaps because the parent window
gesture hasn't timed out or crossed other thresholds yet.

As an inverse example, the events may match a child window subscription
before the root window has rejected ownership. The child window should
be able to accept the touch proactively. This allows for further clients
to receive a TouchEnd event earlier, and means the client may be able to
reduce state being tracked. If this were not allowed, the client would
need to wait until it received ownership before accepting the sequence.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-14 15:21:43 -05:00
Chase Douglas
2ea2f99f4f Extend XIAllowEvents for handling touch grab processing
This removes the XIAllowTouchEvents request, which was the only new
request added for multitouch.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-14 15:19:17 -05:00
Chase Douglas
3c400af4f9 Add event windows to ownership events
Also, match device event structure to make things easy.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:47:15 -05:00
Chase Douglas
dd9e4bc5f5 Really kill touch valuators
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:30:34 -05:00
Peter Hutterer
05fc509fdc specs: if a sequence ends, all clients get TouchPendingEnd
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:29:28 -05:00
Peter Hutterer
94fecdf129 specs: remove broken asciidoc link to XIAllowTouchEvents
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:28:26 -05:00
Peter Hutterer
4782a76b6e specs: remove comment about overlapping selections, not true
There are no overlapping selections for touch events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:27:35 -05:00
Peter Hutterer
dd32802d2e specs: misc typos, rewording, etc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:24:15 -05:00
Chase Douglas
cfa06b98d5 Bump version to 2.1.99 for XI 2.2 multitouch changes
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 15:09:57 -05:00
Chase Douglas
24e7dac91f Switch multitouch additions to XI 2.2
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 14:35:39 -05:00
Chase Douglas
b95adf9b14 Merge remote-tracking branch 'inputproto/master' into multitouch-devel
Conflicts:
	XI2.h
	XI2proto.h
	specs/XI2proto.txt

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-13 14:30:45 -05:00
Chase Douglas
d6dcfd4039 Revert "Specify dependent device pointer/touch handling"
See parent commit for details.

This reverts commit 4adfb5ad6c.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-12 16:01:53 -05:00
Chase Douglas
42284fa0a2 Revert "Fix touch cancel/resume semantics"
The main use case for this was drag and drop, which we realized does not
need any special handling that requires canceling touches.

This reverts commit 9e46820e4a.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-12 15:55:28 -05:00
Peter Hutterer
1b40cc4ff6 specs: extend XI2.1 raw events to include touch events
RawEvents are simple enough that we can re-use the detail field for the
touch ID tracking and just update the respective event types.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-07 10:27:44 -07:00
Peter Hutterer
b55d236a66 Add comment to XI2.h to mark where the 2.1 events start
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-07 10:27:35 -07:00
Peter Hutterer
3d23bf3782 Change file header to note version 2.x
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-07 10:27:24 -07:00
Peter Hutterer
63f3097d26 specs: Fix event lists for asciidoc parsing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-07 10:26:48 -07:00
Peter Hutterer
4329d45d49 specs: Fix in-document references
The primary format for the specs is still the txt format (since that's
guaranteed to be available anywhere, including cgit). Having in-paragraph
references breaks the flow of reading. Fix up some references that aren't
strictly necessary anyway, reword some to be easier to read and change the
titles of some to match the actual title of the section.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-09-07 10:25:36 -07:00
Peter Hutterer
9cfdeedd16 inputproto 2.0.99.1 (first snapshot of 2.1)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-02 15:02:15 +10:00
Peter Hutterer
7d5a303cd8 Move scroll information into a new class.
Using labels only to mark smooth scrolling axes disallows scrolling from
hardware events (e.g. a mouse wheel). If those axes are marked as scrolling
axes instead, the clients lose information which hardware axis this event
corresponds to.

For example, on Wacom devices, the client can benefit from smooth scrolling
on the strip or wheel event but may still require the knowledge whether the
axis is a vertical strip (e.g. Intuos3) or a absolute scrolling wheel (e.g.
Intuos4).

Thus, add a new class to XIQueryDevice that represents scrolling information
on a valuator. One of these ScrollClass may exist for each ValuatorClass if
that valuator is a scrolling valuator. The increment field of this class
removes the requirement for 1.0 == 1 unit of scrolling.

This isn't true in most cases, especially where physical scroll axes are
involved. Wacom Intuos4 scroll rings have a unit size of 3.0 and the driver
historically sent one scroll event per 3.0 increment or decrement. Mapping
one scroll event to 1.0 makes the ring mostly unusable through legacy
button events.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-02 14:53:01 +10:00
Daniel Stone
186aa20619 Document smooth-scrolling support
Two new axes are added to support smooth scrolling: Rel Vert Scroll and
Rel Horiz Scroll.  Cumulative values of 1.0 with either magnitude on
these axes are considered to be equivalent to one legacy ButtonPress
event on the scroll buttons.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-02 14:50:13 +10:00
Daniel Stone
53b58e679f Add XIPointerEmulated for emulated events
The XIPointerEmulated flag on pointer events means that the event was
emulated from a smooth-scroll or touch event to support legacy events,
and the client may ignore this if it is listening to the other events.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-02 14:49:45 +10:00
Peter Hutterer
af1fb609be Add sourceid to RawEvents (#34420)
RawEvents in XI2 do not provide the source ID. The libXi headers however do
and it is currently always 0. Given that the sourceid may be useful for
some clients, send it down the wire.

This has no effect on the wire size of the struct, we can re-use a pad byte
here.

X.Org Bug 34420 <http://bugs.freedesktop.org/show_bug.cgi?id=34420>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-09-02 14:49:39 +10:00
Peter Hutterer
1e63d01d04 XI2.1: send RawEvents at all times.
When a client grabbed a device, XI 2.0 only sends RawEvents to that client.
This behaviour is problematic and cannot be worked around for many
applications that need to continue receiving events.

On the other hand, no client seems to rely on this behaviour or use it to
its advantage. For XI 2.1, disable this behaviour and continue to send raw
events regardless of the grab state of the device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-09-02 14:49:37 +10:00
Peter Hutterer
b35f20b7bd Announce 2.1 availability through the XI_2_Major and XI_2_Minor defines
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-02 14:48:41 +10:00
Peter Hutterer
47a2cc2503 Bump to 2.0.99
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-09-02 14:48:40 +10:00
Chase Douglas
9e46820e4a Fix touch cancel/resume semantics
If a touch is ended through a cancel, the client may never know if the
touch will come back as a resumed sequence. Instead, send a touch update
with the cancel flag, like the pending end flag, and send an end event
only when the full touch sequence has ended.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-24 19:27:06 -07:00
Chase Douglas
79c22a2e7b Fix indentation of active_touches definition
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-24 19:03:28 -07:00
Chase Douglas
cec253561a Introduce Touch grab mode
Touch grabs are not really synchronous nor asynchronous. Use a separate
grab mode value for touch grabs, just to make the protocol seem more
sane.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-24 19:02:27 -07:00
Peter Hutterer
1cb0043358 DeviceEvents: a TouchPendingEnd won't generate further TouchUpdate events
Update, not motion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:31 -07:00
Peter Hutterer
b025106fe8 DeviceEvent: active_touches needs marker that it's XI 2.1
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:26 -07:00
Peter Hutterer
f469fa99ae AllowTouchEvents can take any device id, not just slaves
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:21 -07:00
Peter Hutterer
d7fd289ee0 Indent Ownership explanation for consistent formatting
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:16 -07:00
Peter Hutterer
e51dd1b6bd Reword the passive touch grab rules to be similar to the others
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:11 -07:00
Peter Hutterer
67e06b8f14 Fix missing 'and' in GrabTypeFocusIn description
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:06 -07:00
Peter Hutterer
5b8a8bd0b4 XISelectEvents: BadValue is generated, not returned
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:58:00 -07:00
Peter Hutterer
ae6ba6b37e Coordinates are always absolute, no need to re-state it
Coordinates in DeviceEvents are always absolute, regardless of the axis
mode. The same is true for touch events, stating it again here just adds to
the confusion.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:57:53 -07:00
Peter Hutterer
544ce0cee3 Add two linebreaks for asciidoc list parsing
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:57:45 -07:00
Peter Hutterer
9e46dd3589 Changing the touch device mode generates a DeviceChangedEvent
State it explicitly.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:57:35 -07:00
Peter Hutterer
1b0c016d1f XITouchClass' props needs a num_props
In XI2 requests, the length field isn't enough to determine the number of
elements since it may vary in future versions.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-23 17:57:08 -07:00
Peter Hutterer
94b21b47b5 specs: fix two typos in XI2proto.txt
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-23 15:56:58 +10:00
Peter Hutterer
9f33733fff specs: ValuatorClass includes a mode
Documented in the description, but missing in the definition.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-18 09:00:30 +10:00
Chase Douglas
4adfb5ad6c Specify dependent device pointer/touch handling
With the added rules, trackpads should be manageable no matter what
occurs (button presses and pointer motion). Gesture and touch semantics
during these actions are not well defined, and cancelling touches cleans
up the protocol and implementation.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-05 15:55:13 -07:00
Chase Douglas
29cd8aac67 Use the same valuator axes for pointer and touch events
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
2011-08-05 15:55:13 -07:00