Lines Matching +full:event +full:- +full:touch
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
28 #include <dix-config.h>
46 * Some documentation about touch points:
47 * The driver submits touch events with it's own (unique) touch point ID.
48 * The driver may re-use those IDs, the DDX doesn't care. It just passes on
59 * The DDXTouchPointInfo struct is stored dev->last.touches. When the event
60 * being processed, it becomes a TouchPointInfo in dev->touch-touches which
65 * Check which devices need a bigger touch event queue and grow their
72 * anyway and re-executing this won't help.
82 size = dev->last.num_touches + dev->last.num_touches / 2 + 1; in TouchResizeQueue()
84 tmp = reallocarray(dev->last.touches, size, sizeof(*dev->last.touches)); in TouchResizeQueue()
88 dev->last.touches = tmp; in TouchResizeQueue()
89 for (j = dev->last.num_touches; j < size; j++) in TouchResizeQueue()
90 TouchInitDDXTouchPoint(dev, &dev->last.touches[j]); in TouchResizeQueue()
91 dev->last.num_touches = size; in TouchResizeQueue()
98 * Given the DDX-facing ID (which is _not_ DeviceEvent::detail.touch), find the
101 * @param dev The device to create the touch point for
102 * @param ddx_id Touch id assigned by the driver/ddx
111 if (!dev->touch) in TouchFindByDDXID()
114 for (i = 0; i < dev->last.num_touches; i++) { in TouchFindByDDXID()
115 ti = &dev->last.touches[i]; in TouchFindByDDXID()
116 if (ti->active && ti->ddx_id == ddx_id) in TouchFindByDDXID()
127 * If no other touch points are active, mark new touchpoint for pointer
130 * Returns NULL on failure (i.e. if another touch with that ID is already active,
138 TouchClassPtr t = dev->touch; in TouchBeginDDXTouch()
145 emulate_pointer = (t->mode == XIDirectTouch); in TouchBeginDDXTouch()
153 for (i = 0; i < dev->last.num_touches; i++) { in TouchBeginDDXTouch()
154 /* Only emulate pointer events on the first touch */ in TouchBeginDDXTouch()
155 if (dev->last.touches[i].active) in TouchBeginDDXTouch()
157 else if (!ti) /* ti is now first non-active touch rec */ in TouchBeginDDXTouch()
158 ti = &dev->last.touches[i]; in TouchBeginDDXTouch()
172 ti->active = TRUE; in TouchBeginDDXTouch()
173 ti->ddx_id = ddx_id; in TouchBeginDDXTouch()
178 ti->client_id = client_id; in TouchBeginDDXTouch()
179 ti->emulate_pointer = emulate_pointer; in TouchBeginDDXTouch()
187 TouchClassPtr t = dev->touch; in TouchEndDDXTouch()
192 ti->active = FALSE; in TouchEndDDXTouch()
199 ddxtouch->valuators = valuator_mask_new(dev->valuator->numAxes); in TouchInitDDXTouchPoint()
207 if (index >= t->num_touches) in TouchInitTouchPoint()
209 ti = &t->touches[index]; in TouchInitTouchPoint()
213 ti->valuators = valuator_mask_new(v->numAxes); in TouchInitTouchPoint()
214 if (!ti->valuators) in TouchInitTouchPoint()
217 ti->sprite.spriteTrace = calloc(32, sizeof(*ti->sprite.spriteTrace)); in TouchInitTouchPoint()
218 if (!ti->sprite.spriteTrace) { in TouchInitTouchPoint()
219 valuator_mask_free(&ti->valuators); in TouchInitTouchPoint()
222 ti->sprite.spriteTraceSize = 32; in TouchInitTouchPoint()
223 ti->sprite.spriteTrace[0] = screenInfo.screens[0]->root; in TouchInitTouchPoint()
224 ti->sprite.hot.pScreen = screenInfo.screens[0]; in TouchInitTouchPoint()
225 ti->sprite.hotPhys.pScreen = screenInfo.screens[0]; in TouchInitTouchPoint()
227 ti->client_id = -1; in TouchInitTouchPoint()
238 if (!device->touch || index >= device->touch->num_touches) in TouchFreeTouchPoint()
240 ti = &device->touch->touches[index]; in TouchFreeTouchPoint()
242 if (ti->active) in TouchFreeTouchPoint()
245 for (i = 0; i < ti->num_listeners; i++) in TouchFreeTouchPoint()
246 TouchRemoveListener(ti, ti->listeners[0].listener); in TouchFreeTouchPoint()
248 valuator_mask_free(&ti->valuators); in TouchFreeTouchPoint()
249 free(ti->sprite.spriteTrace); in TouchFreeTouchPoint()
250 ti->sprite.spriteTrace = NULL; in TouchFreeTouchPoint()
251 free(ti->listeners); in TouchFreeTouchPoint()
252 ti->listeners = NULL; in TouchFreeTouchPoint()
253 free(ti->history); in TouchFreeTouchPoint()
254 ti->history = NULL; in TouchFreeTouchPoint()
255 ti->history_size = 0; in TouchFreeTouchPoint()
256 ti->history_elements = 0; in TouchFreeTouchPoint()
260 * Given a client-facing ID (e.g. DeviceEvent::detail.touch), find the
266 TouchClassPtr t = dev->touch; in TouchFindByClientID()
273 for (i = 0; i < t->num_touches; i++) { in TouchFindByClientID()
274 ti = &t->touches[i]; in TouchFindByClientID()
275 if (ti->active && ti->client_id == client_id) in TouchFindByClientID()
286 * Returns NULL on failure (i.e. if another touch with that ID is already active,
294 TouchClassPtr t = dev->touch; in TouchBeginTouch()
304 * touch ids without lifting that one finger off once. In which case in TouchBeginTouch()
310 for (i = 0; i < t->num_touches; i++) { in TouchBeginTouch()
311 ti = &t->touches[i]; in TouchBeginTouch()
312 if (!ti->active) { in TouchBeginTouch()
313 ti->active = TRUE; in TouchBeginTouch()
314 ti->client_id = touchid; in TouchBeginTouch()
315 ti->sourceid = sourceid; in TouchBeginTouch()
316 ti->emulate_pointer = emulate_pointer; in TouchBeginTouch()
321 /* If we get here, then we've run out of touches: enlarge dev->touch and in TouchBeginTouch()
323 tmp = reallocarray(t->touches, t->num_touches + 1, sizeof(*ti)); in TouchBeginTouch()
325 t->touches = tmp; in TouchBeginTouch()
326 t->num_touches++; in TouchBeginTouch()
327 if (TouchInitTouchPoint(t, dev->valuator, t->num_touches - 1)) in TouchBeginTouch()
344 if (ti->emulate_pointer) { in TouchEndTouch()
347 if ((grab = dev->deviceGrab.grab)) { in TouchEndTouch()
348 if (dev->deviceGrab.fromPassiveGrab && in TouchEndTouch()
349 !dev->button->buttonsDown && in TouchEndTouch()
350 !dev->touch->buttonsDown && GrabIsPointerGrab(grab)) in TouchEndTouch()
351 (*dev->deviceGrab.DeactivateGrab) (dev); in TouchEndTouch()
355 for (i = 0; i < ti->num_listeners; i++) in TouchEndTouch()
356 TouchRemoveListener(ti, ti->listeners[0].listener); in TouchEndTouch()
358 ti->active = FALSE; in TouchEndTouch()
359 ti->pending_finish = FALSE; in TouchEndTouch()
360 ti->sprite.spriteTraceGood = 0; in TouchEndTouch()
361 free(ti->listeners); in TouchEndTouch()
362 ti->listeners = NULL; in TouchEndTouch()
363 ti->num_listeners = 0; in TouchEndTouch()
364 ti->num_grabs = 0; in TouchEndTouch()
365 ti->client_id = 0; in TouchEndTouch()
369 valuator_mask_zero(ti->valuators); in TouchEndTouch()
373 * Allocate the event history for this touch pointer. Calling this on a
374 * touchpoint that already has an event history does nothing but counts as
382 if (ti->history) in TouchEventHistoryAllocate()
385 ti->history = calloc(TOUCH_HISTORY_SIZE, sizeof(*ti->history)); in TouchEventHistoryAllocate()
386 ti->history_elements = 0; in TouchEventHistoryAllocate()
387 if (ti->history) in TouchEventHistoryAllocate()
388 ti->history_size = TOUCH_HISTORY_SIZE; in TouchEventHistoryAllocate()
389 return ti->history != NULL; in TouchEventHistoryAllocate()
395 free(ti->history); in TouchEventHistoryFree()
396 ti->history = NULL; in TouchEventHistoryFree()
397 ti->history_size = 0; in TouchEventHistoryFree()
398 ti->history_elements = 0; in TouchEventHistoryFree()
402 * Store the given event on the event history (if one exists)
403 * A touch event history consists of one TouchBegin and several TouchUpdate
404 * events (if applicable) but no TouchEnd event.
412 if (!ti->history) in TouchEventHistoryPush()
415 switch (ev->type) { in TouchEventHistoryPush()
418 if (ti->history_elements > 0) in TouchEventHistoryPush()
430 if (ev->flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING)) in TouchEventHistoryPush()
433 ti->history[ti->history_elements++] = *ev; in TouchEventHistoryPush()
435 if (ti->history_elements > ti->history_size - 1) { in TouchEventHistoryPush()
436 ti->history_elements = ti->history_size - 1; in TouchEventHistoryPush()
437 DebugF("source device %d: history size %zu overflowing for touch %u\n", in TouchEventHistoryPush()
438 ti->sourceid, ti->history_size, ti->client_id); in TouchEventHistoryPush()
447 if (!ti->history) in TouchEventHistoryReplay()
450 TouchDeliverDeviceClassesChangedEvent(ti, ti->history[0].time, resource); in TouchEventHistoryReplay()
452 for (i = 0; i < ti->history_elements; i++) { in TouchEventHistoryReplay()
453 DeviceEvent *ev = &ti->history[i]; in TouchEventHistoryReplay()
455 ev->flags |= TOUCH_REPLAYING; in TouchEventHistoryReplay()
456 ev->resource = resource; in TouchEventHistoryReplay()
458 We're replaying ti->history which contains the TouchBegin + in TouchEventHistoryReplay()
460 listener. If that is a touch listener, everything is dandy. in TouchEventHistoryReplay()
467 prevents handling of touch events for ownership listeners who in TouchEventHistoryReplay()
470 dev->public.processInputProc((InternalEvent*)ev, dev); in TouchEventHistoryReplay()
482 dixLookupDevice(&dev, ti->sourceid, serverClient, DixWriteAccess); in TouchDeliverDeviceClassesChangedEvent()
487 /* UpdateFromMaster generates at most one event */ in TouchDeliverDeviceClassesChangedEvent()
494 dev->public.processInputProc(&dcce, dev); in TouchDeliverDeviceClassesChangedEvent()
502 TouchClassPtr t = dev->touch; in TouchBuildDependentSpriteTrace()
507 * existing touch's sprite if possible, else use the device's sprite. */ in TouchBuildDependentSpriteTrace()
508 for (i = 0; i < t->num_touches; i++) in TouchBuildDependentSpriteTrace()
509 if (!t->touches[i].pending_finish && in TouchBuildDependentSpriteTrace()
510 t->touches[i].sprite.spriteTraceGood > 0) in TouchBuildDependentSpriteTrace()
512 if (i < t->num_touches) in TouchBuildDependentSpriteTrace()
513 srcsprite = &t->touches[i].sprite; in TouchBuildDependentSpriteTrace()
514 else if (dev->spriteInfo->sprite) in TouchBuildDependentSpriteTrace()
515 srcsprite = dev->spriteInfo->sprite; in TouchBuildDependentSpriteTrace()
519 if (srcsprite->spriteTraceGood > sprite->spriteTraceSize) { in TouchBuildDependentSpriteTrace()
520 trace = reallocarray(sprite->spriteTrace, in TouchBuildDependentSpriteTrace()
521 srcsprite->spriteTraceSize, sizeof(*trace)); in TouchBuildDependentSpriteTrace()
523 sprite->spriteTraceGood = 0; in TouchBuildDependentSpriteTrace()
526 sprite->spriteTrace = trace; in TouchBuildDependentSpriteTrace()
527 sprite->spriteTraceSize = srcsprite->spriteTraceGood; in TouchBuildDependentSpriteTrace()
529 memcpy(sprite->spriteTrace, srcsprite->spriteTrace, in TouchBuildDependentSpriteTrace()
530 srcsprite->spriteTraceGood * sizeof(*trace)); in TouchBuildDependentSpriteTrace()
531 sprite->spriteTraceGood = srcsprite->spriteTraceGood; in TouchBuildDependentSpriteTrace()
537 * Ensure a window trace is present in ti->sprite, constructing one for
544 TouchClassPtr t = sourcedev->touch; in TouchBuildSprite()
545 SpritePtr sprite = &ti->sprite; in TouchBuildSprite()
547 if (t->mode == XIDirectTouch) { in TouchBuildSprite()
548 /* Focus immediately under the touchpoint in direct touch mode. in TouchBuildSprite()
550 sprite->spriteTrace[0] = in TouchBuildSprite()
551 sourcedev->spriteInfo->sprite->hotPhys.pScreen->root; in TouchBuildSprite()
552 XYToWindow(sprite, ev->device_event.root_x, ev->device_event.root_y); in TouchBuildSprite()
557 if (sprite->spriteTraceGood <= 0) in TouchBuildSprite()
560 /* Mark which grabs/event selections we're delivering to: max one grab per in TouchBuildSprite()
561 * window plus the bottom-most event selection, plus any active grab. */ in TouchBuildSprite()
562 ti->listeners = calloc(sprite->spriteTraceGood + 2, sizeof(*ti->listeners)); in TouchBuildSprite()
563 if (!ti->listeners) { in TouchBuildSprite()
564 sprite->spriteTraceGood = 0; in TouchBuildSprite()
567 ti->num_listeners = 0; in TouchBuildSprite()
573 * Copy the touch event into the pointer_event, switching the required
574 * fields to make it a correct pointer event.
576 * @param event The original touch event
577 * @param[in] motion_event The respective motion event
578 * @param[in] button_event The respective button event (if any)
582 * @retval 1 only the motion event is valid
583 * @retval 2 motion and button event are valid
586 TouchConvertToPointerEvent(const InternalEvent *event, in TouchConvertToPointerEvent() argument
593 BUG_RETURN_VAL(!event, 0); in TouchConvertToPointerEvent()
596 switch (event->any.type) { in TouchConvertToPointerEvent()
609 BUG_WARN_MSG(1, "Invalid event type %d\n", event->any.type); in TouchConvertToPointerEvent()
613 BUG_WARN_MSG(!(event->device_event.flags & TOUCH_POINTER_EMULATED), in TouchConvertToPointerEvent()
614 "Non-emulating touch event\n"); in TouchConvertToPointerEvent()
616 motion_event->device_event = event->device_event; in TouchConvertToPointerEvent()
617 motion_event->any.type = ET_Motion; in TouchConvertToPointerEvent()
618 motion_event->device_event.detail.button = 0; in TouchConvertToPointerEvent()
619 motion_event->device_event.flags = XIPointerEmulated; in TouchConvertToPointerEvent()
623 button_event->device_event = event->device_event; in TouchConvertToPointerEvent()
624 button_event->any.type = ptrtype; in TouchConvertToPointerEvent()
625 button_event->device_event.flags = XIPointerEmulated; in TouchConvertToPointerEvent()
633 * Return the corresponding pointer emulation internal event type for the given
634 * touch event or 0 if no such event type exists.
637 TouchGetPointerEventType(const InternalEvent *event) in TouchGetPointerEventType() argument
641 switch (event->any.type) { in TouchGetPointerEventType()
659 * the touch sequence.
664 return (ti->listeners[0].listener == resource); in TouchResourceIsOwner()
668 * Add the resource to this touch's listeners.
684 ti->listeners[ti->num_listeners].listener = resource; in TouchAddListener()
685 ti->listeners[ti->num_listeners].resource_type = resource_type; in TouchAddListener()
686 ti->listeners[ti->num_listeners].level = level; in TouchAddListener()
687 ti->listeners[ti->num_listeners].state = state; in TouchAddListener()
688 ti->listeners[ti->num_listeners].type = type; in TouchAddListener()
689 ti->listeners[ti->num_listeners].window = window; in TouchAddListener()
690 ti->listeners[ti->num_listeners].grab = g; in TouchAddListener()
692 ti->num_grabs++; in TouchAddListener()
693 ti->num_listeners++; in TouchAddListener()
697 * Remove the resource from this touch's listeners.
707 for (i = 0; i < ti->num_listeners; i++) { in TouchRemoveListener()
709 TouchListener *listener = &ti->listeners[i]; in TouchRemoveListener()
711 if (listener->listener != resource) in TouchRemoveListener()
714 if (listener->grab) { in TouchRemoveListener()
715 FreeGrab(listener->grab); in TouchRemoveListener()
716 listener->grab = NULL; in TouchRemoveListener()
717 ti->num_grabs--; in TouchRemoveListener()
720 for (j = i; j < ti->num_listeners - 1; j++) in TouchRemoveListener()
721 ti->listeners[j] = ti->listeners[j + 1]; in TouchRemoveListener()
722 ti->num_listeners--; in TouchRemoveListener()
723 ti->listeners[ti->num_listeners].listener = 0; in TouchRemoveListener()
724 ti->listeners[ti->num_listeners].state = LISTENER_AWAITING_BEGIN; in TouchRemoveListener()
739 if (grab->grabtype == XI2) { in TouchAddGrabListener()
740 if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchOwnership)) in TouchAddGrabListener()
742 if (!xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin)) in TouchAddGrabListener()
745 else if (grab->grabtype == XI || grab->grabtype == CORE) { in TouchAddGrabListener()
751 TouchAddListener(ti, grab->resource, RT_NONE, grab->grabtype, in TouchAddGrabListener()
752 type, LISTENER_AWAITING_BEGIN, grab->window, grab); in TouchAddGrabListener()
763 Bool check_core = IsMaster(dev) && ti->emulate_pointer; in TouchAddPassiveGrabListener()
779 uint16_t evtype = 0; /* may be event type or emulated event type */ in TouchAddRegularListener()
783 evtype = GetXI2Type(ev->any.type); in TouchAddRegularListener()
784 mask = EventIsDeliverable(dev, ev->any.type, win); in TouchAddRegularListener()
785 if (!mask && !ti->emulate_pointer) in TouchAddRegularListener()
787 else if (!mask) { /* now try for pointer event */ in TouchAddRegularListener()
800 nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { in TouchAddRegularListener()
801 if (!xi2mask_isset(iclients->xi2mask, dev, evtype)) in TouchAddRegularListener()
804 if (!xi2mask_isset(iclients->xi2mask, dev, XI_TouchOwnership)) in TouchAddRegularListener()
807 TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI2, in TouchAddRegularListener()
817 nt_list_for_each_entry(iclients, inputMasks->inputClients, next) { in TouchAddRegularListener()
818 if (!(iclients->mask[dev->id] & xi_filter)) in TouchAddRegularListener()
822 TouchAddListener(ti, iclients->resource, RT_INPUTCLIENT, XI, in TouchAddRegularListener()
835 if (IsMaster(dev) && (win->eventMask & core_filter)) { in TouchAddRegularListener()
837 TouchAddListener(ti, win->drawable.id, RT_WINDOW, CORE, in TouchAddRegularListener()
845 if (!(oclients->mask & core_filter)) in TouchAddRegularListener()
849 TouchAddListener(ti, oclients->resource, RT_OTHERCLIENT, CORE, in TouchAddRegularListener()
862 if (!ti->emulate_pointer && in TouchAddActiveGrabListener()
863 (grab->grabtype == CORE || grab->grabtype == XI)) in TouchAddActiveGrabListener()
866 if (!ti->emulate_pointer && in TouchAddActiveGrabListener()
867 grab->grabtype == XI2 && in TouchAddActiveGrabListener()
868 !xi2mask_isset(grab->xi2mask, dev, XI_TouchBegin)) in TouchAddActiveGrabListener()
878 SpritePtr sprite = &ti->sprite; in TouchSetupListeners()
881 if (dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab) in TouchSetupListeners()
882 TouchAddActiveGrabListener(dev, ti, ev, dev->deviceGrab.grab); in TouchSetupListeners()
884 /* We set up an active touch listener for existing touches, but not any in TouchSetupListeners()
886 if (ev->any.type != ET_TouchBegin) in TouchSetupListeners()
891 for (i = 0; i < sprite->spriteTraceGood; i++) { in TouchSetupListeners()
892 win = sprite->spriteTrace[i]; in TouchSetupListeners()
896 /* Find the first client with an applicable event selection, in TouchSetupListeners()
898 for (i = sprite->spriteTraceGood - 1; i >= 0; i--) { in TouchSetupListeners()
901 win = sprite->spriteTrace[i]; in TouchSetupListeners()
909 * Remove the touch pointer grab from the device. Called from
919 if (!dev->touch) in TouchRemovePointerGrab()
922 grab = dev->deviceGrab.grab; in TouchRemovePointerGrab()
926 ev = dev->deviceGrab.sync.event; in TouchRemovePointerGrab()
930 ti = TouchFindByClientID(dev, ev->touchid); in TouchRemovePointerGrab()
937 /* As touch grabs don't turn into active grabs with their own resources, we
951 for (dev = inputInfo.devices; dev; dev = dev->next) { in TouchListenerGone()
952 if (!dev->touch) in TouchListenerGone()
955 for (i = 0; i < dev->touch->num_touches; i++) { in TouchListenerGone()
956 ti = &dev->touch->touches[i]; in TouchListenerGone()
957 if (!ti->active) in TouchListenerGone()
960 for (j = 0; j < ti->num_listeners; j++) { in TouchListenerGone()
961 if (CLIENT_BITS(ti->listeners[j].listener) != resource) in TouchListenerGone()
965 ti->listeners[j].listener, 0); in TouchListenerGone()
986 BUG_RETURN_VAL(listener >= ti->num_listeners, BadMatch); in TouchListenerAcceptReject()
990 TouchRejected(dev, ti, ti->listeners[listener].listener, NULL); in TouchListenerAcceptReject()
992 ti->listeners[listener].state = LISTENER_EARLY_ACCEPT; in TouchListenerAcceptReject()
998 BUG_RETURN_VAL_MSG(!events, BadAlloc, "Failed to allocate touch ownership events\n"); in TouchListenerAcceptReject()
1001 ti->listeners[0].listener, 0); in TouchListenerAcceptReject()
1002 BUG_WARN_MSG(nev == 0, "Failed to get touch ownership events\n"); in TouchListenerAcceptReject()
1019 if (!dev->touch) { in TouchAcceptReject()
1020 *error = dev->id; in TouchAcceptReject()
1030 for (i = 0; i < ti->num_listeners; i++) { in TouchAcceptReject()
1031 if (CLIENT_ID(ti->listeners[i].listener) == client->index && in TouchAcceptReject()
1032 ti->listeners[i].window->drawable.id == grab_window) in TouchAcceptReject()
1035 if (i == ti->num_listeners) in TouchAcceptReject()
1052 for (i = 0; i < dev->last.num_touches; i++) { in TouchEndPhysicallyActiveTouches()
1053 DDXTouchPointInfoPtr ddxti = dev->last.touches + i; in TouchEndPhysicallyActiveTouches()
1055 if (ddxti->active) { in TouchEndPhysicallyActiveTouches()
1057 int nevents = GetTouchEvents(eventlist, dev, ddxti->ddx_id, in TouchEndPhysicallyActiveTouches()
1070 * Generate and deliver a TouchEnd event.
1072 * @param dev The device to deliver the event for.
1073 * @param ti The touch point record to deliver the event for.
1074 * @param flags Internal event flags. The called does not need to provide
1082 InternalEvent event; in TouchEmitTouchEnd() local
1084 /* We're not processing a touch end for a frozen device */ in TouchEmitTouchEnd()
1085 if (dev->deviceGrab.sync.frozen) in TouchEmitTouchEnd()
1089 if (ti->emulate_pointer) in TouchEmitTouchEnd()
1092 GetDixTouchEnd(&event, dev, ti, flags); in TouchEmitTouchEnd()
1093 DeliverTouchEvents(dev, ti, &event, resource); in TouchEmitTouchEnd()
1094 if (ti->num_grabs == 0) in TouchEmitTouchEnd()
1095 UpdateDeviceState(dev, &event.device_event); in TouchEmitTouchEnd()
1106 if (ti->pending_finish) in TouchAcceptAndEnd()
1108 if (ti->num_listeners <= 1) in TouchAcceptAndEnd()