Commit Graph

31023 Commits

Author SHA1 Message Date
Matthias Clasen
67245ed83e paned: Only look at direct touch devices for now 2012-02-24 14:39:10 -05:00
Matthias Clasen
4becb95192 menu: Only look at direct touch devices for now 2012-02-24 14:39:10 -05:00
Matthias Clasen
eed8b95744 gdk: Adapt to direct/indirect touch device types
We use the XITouchClass.mode information to determine if
a device is direct or indirect.
2012-02-24 14:39:10 -05:00
Matthias Clasen
adefcf2ee6 gdk: Add separate device types for direct and indirect touch 2012-02-24 14:39:10 -05:00
Matthias Clasen
2adb94eed3 gdk: Fix GDK_ALL_EVENTS_MASK 2012-02-24 14:39:09 -05:00
Matthias Clasen
dfda82acd4 gdk: Drop gdk_event_get_touch_area for now
It has no users, and the implementation probably has to be moved
to be xi2-specific anyway.
2012-02-24 14:39:07 -05:00
Matthias Clasen
3e298f8605 paned: Use touch sequences instead of touch ids 2012-02-24 14:38:45 -05:00
Matthias Clasen
5195cb807c gdk: Change touch_id to touch_sequence
Change the GdkEventTouch struct to contain a GdkTouchSequence
pointer instead of an integer and adapt all places in gdk
that were dealing with touch ids.
2012-02-24 14:38:45 -05:00
Matthias Clasen
cca0efbdf0 Replace gdk_event_get_touch_id
Change this to gdk_event_get_touch_sequence, and make it
return an opaque pointer instead of an integer.
2012-02-24 14:38:37 -05:00
Matthias Clasen
02fc18f34c Remove GdkEventButton.touch_id from the docs
Button events no longer have a touch id
2012-02-24 11:53:01 -05:00
Matthias Clasen
59e14c5b56 Remove the GdkEventTouch.button field
Touch events don't have a button.
2012-02-24 11:51:52 -05:00
Matthias Clasen
acb93bd418 Fix the build 2012-02-24 11:45:33 -05:00
Matthias Clasen
6ddf197e97 paned: Deal with new touch events 2012-02-24 10:21:06 -05:00
Matthias Clasen
953f383d62 button: Use ::touch-event 2012-02-24 10:20:40 -05:00
Matthias Clasen
468e2957e7 gtk: Add a separate ::touch-event signal
This gets emitted for touch events now.
2012-02-24 10:19:59 -05:00
Matthias Clasen
064937ba1c gtk: Adapt event propagation code to new touch event types 2012-02-24 10:18:40 -05:00
Matthias Clasen
bb4c1726ab xi2: Adapt to GdkEventTouch
Translate XI_TouchBegin/Update/End to GDK_TOUCH_BEGIN/UPDATE/END
events.
2012-02-24 10:17:43 -05:00
Matthias Clasen
4a26fcf212 gdk: Adapt more code to handle GdkEventTouch
The changes to the type masks in this patch are meant to
make it so that touch events only go to windows that explicitly
select for them. It may not be correct.
2012-02-24 10:15:43 -05:00
Matthias Clasen
9fc20c585d gdk: Adapt generic event code to deal with GdkEventTouch 2012-02-24 10:14:59 -05:00
Matthias Clasen
dda2ce7455 gdk: Adapt event documentation to mention the new types 2012-02-24 10:14:21 -05:00
Matthias Clasen
727200c6a0 gdk: Introduce an independent GdkEventTouch
This commit introduces GDK_TOUCH_BEGIN/UPDATE/END/CANCEL
and a separate GdkEventTouch struct that they use. This
is closer to the touch event API of other platforms and
matches the xi2 events closely, too.
2012-02-24 10:12:21 -05:00
Carlos Garnacho
b6f6ff901c paned: Use 2-finger interaction to resize the panes
If 2 touches happen to be both at left and right of the handle,
enter into resize mode. Else, the event(s) will be propagated
further to the children.
2012-02-24 03:24:15 -05:00
Carlos Garnacho
0a535fe441 gdk: Use the last alive grab in order to get the event window
If an active grab kicks in on a different window, _gdk_display_has_device_grab()
would still find the former implicit grab for the window below the pointer, thus
sending events to an unrelated place.
2012-02-24 03:24:15 -05:00
Carlos Garnacho
d3f8b132d6 gdk: Don't mutate pointer events to touch events just because a grab says so
If a grab with GDK_TOUCH_MASK kicks in due to a touch sequence emulating pointer
events, don't mutate the sequence into emitting touch events right away.
2012-02-24 03:24:15 -05:00
Carlos Garnacho
b04f2cfb1c gdk: Let implicit touch grabs coexist with an implicit pointer grab
Create the backing GdkTouchGrabInfo for touches even if the pointer
emulating touch sequence is already holding an implicit grab on a
window that didn't select for touch events.
2012-02-24 03:24:14 -05:00
Carlos Garnacho
1e116569eb gdk: Don't fully destroy the implicit touch grab on ::grab-broken
the backing GdkTouchGrabInfo will be needed if the overriding device
grab finishes before the touch does in order to send events back to
the implicit grab window. Instead, wait until the touch is physically
finished before removing the matching GdkTouchGrabInfo
2012-02-24 03:24:14 -05:00
Carlos Garnacho
127c0c213d xi2: Mark touch events emulating the pointer as such 2012-02-24 03:24:14 -05:00
Carlos Garnacho
0cfd17eb77 gdk: Listen to touch events by default on the native window
GDK will only receive touch events when dealing with a multitouch
device, so these must be transformed to pointer events if the
client-side window receiving the event doesn't listen to touch
events, and the touch sequence the event is from does emulate
the pointer.

If a sequence emulates pointer events, it will result in a
button-press, N motions with GDK_BUTTON1_MASK set and a
button-release event, and it will deliver crossing events
as specified by the current device grab.
2012-02-24 03:24:14 -05:00
Carlos Garnacho
30b3de7778 gdk: Only trigger motion hints machinery on motion events
Touch events have no need for it, plus the concept behind
gdk_event_request_motions() doesn't wrap around multiple
touches within a device.
2012-02-24 03:24:13 -05:00
Carlos Garnacho
2044fb1a3b gdk: Have touch grabs behave like the implicit grab wrt crossing events
These are equivalent to an implicit grab (with !owner_events), so
if the touch leaves or enters the grab window, the other window
won't receive the corresponding counter-event.
2012-02-24 03:24:13 -05:00
Carlos Garnacho
f09476686c button: Handle touch events
Touch events don't generate crossing events themselves, so
do not rely on these to determine whether the button release
happened within the event window.
2012-02-24 03:24:13 -05:00
Carlos Garnacho
123c0e0f3a gtk: Rewrite touch events wrt the window group too
Likewise to pointer events, have touch events during a device
grab with owner_events=TRUE be delivered normally as long as
the widget pertains to the same window group.
2012-02-24 03:24:12 -05:00
Carlos Garnacho
31a79bd080 Make touch events go through csw/widget event handling
In GtkWidget, touch events go through the same handler
than motion events, with the difference that touch_id
will have something meaningful there.

Touch events need to be explicitly selected, so if this
is enabled, the possibility of different motion streams
with different touch IDs must be handled in some way.
2012-02-24 03:24:12 -05:00
Carlos Garnacho
41be0fae6d gdk: handle implicit touch grabs
If the touch sequence happens on a window with GDK_TOUCH_MASK set,
a GdkTouchGrabInfo is created to back it up. Else a device grab is
only created if the sequence emulates the pointer.

If both a device and a touch grab are present on a window, the later
of them both is obeyed, Any grab on the device happening after a
touch grab generates grab broken on all the windows an implicit
touch grab was going on, and all touches would be automatically
removed from every touch cluster.
2012-02-24 03:24:12 -05:00
Carlos Garnacho
d19998d2a5 gdk: Add internal API to deal with touch implicit grabs
The necessary information about a touch implicit grab is stored in
GdkTouchGrabInfo structs, these are meant to be transient to the
touch sequence.
2012-02-24 03:24:12 -05:00
Carlos Garnacho
89e53a0c61 gdk: Don't change window_under_pointer for pure touch events
Only touch events that emulate the pointer do change it.
2012-02-24 03:24:11 -05:00
Carlos Garnacho
b835349fa5 xi2: set pointer emulated flags on events with XIPointerEmulated 2012-02-24 03:24:11 -05:00
Carlos Garnacho
27b3dfb031 gdk: Add internal API to set "pointer emulated" flag on events
This flag will be used for non-pointer events that are emulated
from eg. touch events, or pointer events being emulated.
2012-02-24 03:24:11 -05:00
Carlos Garnacho
182b1afa18 Add gdk_event_get_touch_area()
If given an event coming from a touch devices,
this functions will read the MT major/minor/orientation
axes and return a cairo_region_t with the touch shape.
2012-02-24 03:24:10 -05:00
Carlos Garnacho
48c70d1a1d Add gdk_event_get_touch_id()
Just a helper function to get the touch ID from touch events, it
returns FALSE in any other case.
2012-02-24 03:24:10 -05:00
Carlos Garnacho
910ca064e4 xi2: Set GDK_BUTTON1_MASK on touch events
GTK+ handles both touch and pointer events through the same
event handlers, so enable this modifier on touch events to
avoid much special casing.
2012-02-24 03:24:10 -05:00
Carlos Garnacho
9775183efb xi2: Use GDK_SOURCE_TOUCH for multitouch devices
Any device with a XITouchClassInfo with num_touches > 0
qualifies as multitouch.
2012-02-24 03:24:10 -05:00
Carlos Garnacho
605c7e161b xi2: Handle touch events
GdkDeviceManagerXI2 now handles touch events.
TouchMotion events are translated to GDK_TOUCH_MOTION events,
TouchBegin/End events are translated to the newly introduced
GDK_TOUCH_PRESS/RELEASE events.
2012-02-24 03:24:09 -05:00
Carlos Garnacho
f16fdbc6e4 configure: Detect XInput 2.2 2012-02-24 03:24:09 -05:00
Carlos Garnacho
2dc59d153c xi2: Add major/minor properties to XI2 device manager
This may be used to turn on/off the features that are added to
new XInput2 revisions.
2012-02-24 03:24:09 -05:00
Carlos Garnacho
936d3df7c7 range: Have slider jump to the pointer coordinates on touch devices
This widget is too narrow to make touch interaction tricky enough, so
don't add the penalty of having the slider run farther from the touch
coordinates if it happens to miss the slider.
2012-02-24 03:24:08 -05:00
Carlos Garnacho
330a9bfbc3 menus: Don't popdown submenus on button release for touch devices
This is so submenus stay open as the parent menu item is
pressed/released, since the user would typically lift the
finger in order to select a submenu item.
2012-02-24 03:24:08 -05:00
Carlos Garnacho
59f7a3b5b4 settings: Deprecate gtk-touchscreen-mode
It's not used anywhere in GTK+ anymore.
2012-02-24 03:24:08 -05:00
Carlos Garnacho
bc1ee7bd0c range: Remove gtk-touchscreen-mode usage
Emulated crossing events with mode GDK_CROSSING_TOUCH_PRESS/RELEASE
already cater dynamically for the "don't prelight on touch devices"
usecase.
2012-02-24 03:24:08 -05:00
Carlos Garnacho
5b32261d5a togglebutton: Remove gtk-touchcreen-mode usage
Emulated crossing events with mode GDK_CROSSING_TOUCH_PRESS/RELEASE
already cater dynamically for the "don't prelight on touch devices"
usecase.
2012-02-24 03:24:07 -05:00