Lines Matching +full:event +full:- +full:touch

16 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
25 Copyright 1989 by Hewlett-Packard Company, Palo Alto, California.
33 supporting documentation, and that the name of Hewlett-Packard not be
37 HEWLETT-PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
38 ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
39 HEWLETT-PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
64 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
82 #include <dix-config.h>
112 #define WID(w) ((w) ? ((w)->drawable.id) : 0)
143 IsPointerEvent(InternalEvent *event) in IsPointerEvent() argument
145 switch (event->any.type) { in IsPointerEvent()
158 IsTouchEvent(InternalEvent *event) in IsTouchEvent() argument
160 switch (event->any.type) { in IsTouchEvent()
172 * @return the device matching the deviceid of the device set in the event, or
173 * NULL if the event is not an XInput event.
180 if (xE->u.u.type == DeviceButtonPress || in XIGetDevice()
181 xE->u.u.type == DeviceButtonRelease || in XIGetDevice()
182 xE->u.u.type == DeviceMotionNotify || in XIGetDevice()
183 xE->u.u.type == ProximityIn || in XIGetDevice()
184 xE->u.u.type == ProximityOut || xE->u.u.type == DevicePropertyNotify) { in XIGetDevice()
188 id = ((deviceKeyButtonPointer *) xE)->deviceid & ~MORE_EVENTS; in XIGetDevice()
198 * Copy the device->key into master->key and send a mapping notify to the
200 * master->key needs to be allocated by the caller.
207 * - different slave device on same master
208 * - different master
226 KeyClassPtr mk = master->key; in CopyKeyClass()
231 mk->sourceid = device->id; in CopyKeyClass()
233 if (!XkbDeviceApplyKeymap(master, device->key->xkbInfo->desc)) in CopyKeyClass()
247 if (from->intfeed) { in DeepCopyFeedbackClasses()
250 if (!to->intfeed) { in DeepCopyFeedbackClasses()
251 classes = to->unused_classes; in DeepCopyFeedbackClasses()
252 to->intfeed = classes->intfeed; in DeepCopyFeedbackClasses()
253 classes->intfeed = NULL; in DeepCopyFeedbackClasses()
256 i = &to->intfeed; in DeepCopyFeedbackClasses()
257 for (it = from->intfeed; it; it = it->next) { in DeepCopyFeedbackClasses()
265 (*i)->CtrlProc = it->CtrlProc; in DeepCopyFeedbackClasses()
266 (*i)->ctrl = it->ctrl; in DeepCopyFeedbackClasses()
268 i = &(*i)->next; in DeepCopyFeedbackClasses()
271 else if (to->intfeed && !from->intfeed) { in DeepCopyFeedbackClasses()
272 classes = to->unused_classes; in DeepCopyFeedbackClasses()
273 classes->intfeed = to->intfeed; in DeepCopyFeedbackClasses()
274 to->intfeed = NULL; in DeepCopyFeedbackClasses()
277 if (from->stringfeed) { in DeepCopyFeedbackClasses()
280 if (!to->stringfeed) { in DeepCopyFeedbackClasses()
281 classes = to->unused_classes; in DeepCopyFeedbackClasses()
282 to->stringfeed = classes->stringfeed; in DeepCopyFeedbackClasses()
283 classes->stringfeed = NULL; in DeepCopyFeedbackClasses()
286 s = &to->stringfeed; in DeepCopyFeedbackClasses()
287 for (it = from->stringfeed; it; it = it->next) { in DeepCopyFeedbackClasses()
295 (*s)->CtrlProc = it->CtrlProc; in DeepCopyFeedbackClasses()
296 (*s)->ctrl = it->ctrl; in DeepCopyFeedbackClasses()
298 s = &(*s)->next; in DeepCopyFeedbackClasses()
301 else if (to->stringfeed && !from->stringfeed) { in DeepCopyFeedbackClasses()
302 classes = to->unused_classes; in DeepCopyFeedbackClasses()
303 classes->stringfeed = to->stringfeed; in DeepCopyFeedbackClasses()
304 to->stringfeed = NULL; in DeepCopyFeedbackClasses()
307 if (from->bell) { in DeepCopyFeedbackClasses()
310 if (!to->bell) { in DeepCopyFeedbackClasses()
311 classes = to->unused_classes; in DeepCopyFeedbackClasses()
312 to->bell = classes->bell; in DeepCopyFeedbackClasses()
313 classes->bell = NULL; in DeepCopyFeedbackClasses()
316 b = &to->bell; in DeepCopyFeedbackClasses()
317 for (it = from->bell; it; it = it->next) { in DeepCopyFeedbackClasses()
325 (*b)->BellProc = it->BellProc; in DeepCopyFeedbackClasses()
326 (*b)->CtrlProc = it->CtrlProc; in DeepCopyFeedbackClasses()
327 (*b)->ctrl = it->ctrl; in DeepCopyFeedbackClasses()
329 b = &(*b)->next; in DeepCopyFeedbackClasses()
332 else if (to->bell && !from->bell) { in DeepCopyFeedbackClasses()
333 classes = to->unused_classes; in DeepCopyFeedbackClasses()
334 classes->bell = to->bell; in DeepCopyFeedbackClasses()
335 to->bell = NULL; in DeepCopyFeedbackClasses()
338 if (from->leds) { in DeepCopyFeedbackClasses()
341 if (!to->leds) { in DeepCopyFeedbackClasses()
342 classes = to->unused_classes; in DeepCopyFeedbackClasses()
343 to->leds = classes->leds; in DeepCopyFeedbackClasses()
344 classes->leds = NULL; in DeepCopyFeedbackClasses()
347 l = &to->leds; in DeepCopyFeedbackClasses()
348 for (it = from->leds; it; it = it->next) { in DeepCopyFeedbackClasses()
356 (*l)->CtrlProc = it->CtrlProc; in DeepCopyFeedbackClasses()
357 (*l)->ctrl = it->ctrl; in DeepCopyFeedbackClasses()
358 if ((*l)->xkb_sli) in DeepCopyFeedbackClasses()
359 XkbFreeSrvLedInfo((*l)->xkb_sli); in DeepCopyFeedbackClasses()
360 (*l)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, NULL, *l); in DeepCopyFeedbackClasses()
362 l = &(*l)->next; in DeepCopyFeedbackClasses()
365 else if (to->leds && !from->leds) { in DeepCopyFeedbackClasses()
366 classes = to->unused_classes; in DeepCopyFeedbackClasses()
367 classes->leds = to->leds; in DeepCopyFeedbackClasses()
368 to->leds = NULL; in DeepCopyFeedbackClasses()
377 /* XkbInitDevice (->XkbInitIndicatorMap->XkbFindSrvLedInfo) relies on the in DeepCopyKeyboardClasses()
380 if (from->kbdfeed) { in DeepCopyKeyboardClasses()
383 if (!to->kbdfeed) { in DeepCopyKeyboardClasses()
384 classes = to->unused_classes; in DeepCopyKeyboardClasses()
386 to->kbdfeed = classes->kbdfeed; in DeepCopyKeyboardClasses()
387 if (!to->kbdfeed) in DeepCopyKeyboardClasses()
389 classes->kbdfeed = NULL; in DeepCopyKeyboardClasses()
392 k = &to->kbdfeed; in DeepCopyKeyboardClasses()
393 for (it = from->kbdfeed; it; it = it->next) { in DeepCopyKeyboardClasses()
401 (*k)->BellProc = it->BellProc; in DeepCopyKeyboardClasses()
402 (*k)->CtrlProc = it->CtrlProc; in DeepCopyKeyboardClasses()
403 (*k)->ctrl = it->ctrl; in DeepCopyKeyboardClasses()
404 if ((*k)->xkb_sli) in DeepCopyKeyboardClasses()
405 XkbFreeSrvLedInfo((*k)->xkb_sli); in DeepCopyKeyboardClasses()
406 (*k)->xkb_sli = XkbCopySrvLedInfo(from, it->xkb_sli, *k, NULL); in DeepCopyKeyboardClasses()
408 k = &(*k)->next; in DeepCopyKeyboardClasses()
411 else if (to->kbdfeed && !from->kbdfeed) { in DeepCopyKeyboardClasses()
412 classes = to->unused_classes; in DeepCopyKeyboardClasses()
413 classes->kbdfeed = to->kbdfeed; in DeepCopyKeyboardClasses()
414 to->kbdfeed = NULL; in DeepCopyKeyboardClasses()
417 if (from->key) { in DeepCopyKeyboardClasses()
418 if (!to->key) { in DeepCopyKeyboardClasses()
419 classes = to->unused_classes; in DeepCopyKeyboardClasses()
420 to->key = classes->key; in DeepCopyKeyboardClasses()
421 if (!to->key) in DeepCopyKeyboardClasses()
424 classes->key = NULL; in DeepCopyKeyboardClasses()
429 else if (to->key && !from->key) { in DeepCopyKeyboardClasses()
430 classes = to->unused_classes; in DeepCopyKeyboardClasses()
431 classes->key = to->key; in DeepCopyKeyboardClasses()
432 to->key = NULL; in DeepCopyKeyboardClasses()
436 * pointer point into the xkbInfo->desc struct. XkbCopySrvLedInfo in DeepCopyKeyboardClasses()
439 if (to->kbdfeed) { in DeepCopyKeyboardClasses()
442 for (k = to->kbdfeed; k; k = k->next) { in DeepCopyKeyboardClasses()
443 if (!k->xkb_sli) in DeepCopyKeyboardClasses()
445 if (k->xkb_sli->flags & XkbSLI_IsDefault) { in DeepCopyKeyboardClasses()
446 k->xkb_sli->names = to->key->xkbInfo->desc->names->indicators; in DeepCopyKeyboardClasses()
447 k->xkb_sli->maps = to->key->xkbInfo->desc->indicators->maps; in DeepCopyKeyboardClasses()
458 if (from->focus) { in DeepCopyKeyboardClasses()
459 if (!to->focus) { in DeepCopyKeyboardClasses()
462 classes = to->unused_classes; in DeepCopyKeyboardClasses()
463 to->focus = classes->focus; in DeepCopyKeyboardClasses()
464 if (!to->focus) { in DeepCopyKeyboardClasses()
465 to->focus = calloc(1, sizeof(FocusClassRec)); in DeepCopyKeyboardClasses()
466 if (!to->focus) in DeepCopyKeyboardClasses()
470 classes->focus = NULL; in DeepCopyKeyboardClasses()
472 oldTrace = to->focus->trace; in DeepCopyKeyboardClasses()
473 memcpy(to->focus, from->focus, sizeof(FocusClassRec)); in DeepCopyKeyboardClasses()
474 to->focus->trace = reallocarray(oldTrace, in DeepCopyKeyboardClasses()
475 to->focus->traceSize, in DeepCopyKeyboardClasses()
477 if (!to->focus->trace && to->focus->traceSize) in DeepCopyKeyboardClasses()
479 memcpy(to->focus->trace, from->focus->trace, in DeepCopyKeyboardClasses()
480 from->focus->traceSize * sizeof(WindowPtr)); in DeepCopyKeyboardClasses()
481 to->focus->sourceid = from->id; in DeepCopyKeyboardClasses()
484 else if (to->focus) { in DeepCopyKeyboardClasses()
485 classes = to->unused_classes; in DeepCopyKeyboardClasses()
486 classes->focus = to->focus; in DeepCopyKeyboardClasses()
487 to->focus = NULL; in DeepCopyKeyboardClasses()
500 if (from->ptrfeed) { in DeepCopyPointerClasses()
503 if (!to->ptrfeed) { in DeepCopyPointerClasses()
504 classes = to->unused_classes; in DeepCopyPointerClasses()
505 to->ptrfeed = classes->ptrfeed; in DeepCopyPointerClasses()
506 classes->ptrfeed = NULL; in DeepCopyPointerClasses()
509 p = &to->ptrfeed; in DeepCopyPointerClasses()
510 for (it = from->ptrfeed; it; it = it->next) { in DeepCopyPointerClasses()
518 (*p)->CtrlProc = it->CtrlProc; in DeepCopyPointerClasses()
519 (*p)->ctrl = it->ctrl; in DeepCopyPointerClasses()
521 p = &(*p)->next; in DeepCopyPointerClasses()
524 else if (to->ptrfeed && !from->ptrfeed) { in DeepCopyPointerClasses()
525 classes = to->unused_classes; in DeepCopyPointerClasses()
526 classes->ptrfeed = to->ptrfeed; in DeepCopyPointerClasses()
527 to->ptrfeed = NULL; in DeepCopyPointerClasses()
530 if (from->valuator) { in DeepCopyPointerClasses()
533 if (!to->valuator) { in DeepCopyPointerClasses()
534 classes = to->unused_classes; in DeepCopyPointerClasses()
535 to->valuator = classes->valuator; in DeepCopyPointerClasses()
536 if (to->valuator) in DeepCopyPointerClasses()
537 classes->valuator = NULL; in DeepCopyPointerClasses()
540 v = AllocValuatorClass(to->valuator, from->valuator->numAxes); in DeepCopyPointerClasses()
545 to->valuator = v; in DeepCopyPointerClasses()
546 memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo)); in DeepCopyPointerClasses()
548 v->sourceid = from->id; in DeepCopyPointerClasses()
550 else if (to->valuator && !from->valuator) { in DeepCopyPointerClasses()
551 classes = to->unused_classes; in DeepCopyPointerClasses()
552 classes->valuator = to->valuator; in DeepCopyPointerClasses()
553 to->valuator = NULL; in DeepCopyPointerClasses()
556 if (from->button) { in DeepCopyPointerClasses()
557 if (!to->button) { in DeepCopyPointerClasses()
558 classes = to->unused_classes; in DeepCopyPointerClasses()
559 to->button = classes->button; in DeepCopyPointerClasses()
560 if (!to->button) { in DeepCopyPointerClasses()
561 to->button = calloc(1, sizeof(ButtonClassRec)); in DeepCopyPointerClasses()
562 if (!to->button) in DeepCopyPointerClasses()
566 classes->button = NULL; in DeepCopyPointerClasses()
569 if (from->button->xkb_acts) { in DeepCopyPointerClasses()
570 if (!to->button->xkb_acts) { in DeepCopyPointerClasses()
571 to->button->xkb_acts = calloc(1, sizeof(XkbAction)); in DeepCopyPointerClasses()
572 if (!to->button->xkb_acts) in DeepCopyPointerClasses()
575 memcpy(to->button->xkb_acts, from->button->xkb_acts, in DeepCopyPointerClasses()
579 free(to->button->xkb_acts); in DeepCopyPointerClasses()
581 memcpy(to->button->labels, from->button->labels, in DeepCopyPointerClasses()
582 from->button->numButtons * sizeof(Atom)); in DeepCopyPointerClasses()
583 to->button->sourceid = from->id; in DeepCopyPointerClasses()
585 else if (to->button && !from->button) { in DeepCopyPointerClasses()
586 classes = to->unused_classes; in DeepCopyPointerClasses()
587 classes->button = to->button; in DeepCopyPointerClasses()
588 to->button = NULL; in DeepCopyPointerClasses()
591 if (from->proximity) { in DeepCopyPointerClasses()
592 if (!to->proximity) { in DeepCopyPointerClasses()
593 classes = to->unused_classes; in DeepCopyPointerClasses()
594 to->proximity = classes->proximity; in DeepCopyPointerClasses()
595 if (!to->proximity) { in DeepCopyPointerClasses()
596 to->proximity = calloc(1, sizeof(ProximityClassRec)); in DeepCopyPointerClasses()
597 if (!to->proximity) in DeepCopyPointerClasses()
601 classes->proximity = NULL; in DeepCopyPointerClasses()
603 memcpy(to->proximity, from->proximity, sizeof(ProximityClassRec)); in DeepCopyPointerClasses()
604 to->proximity->sourceid = from->id; in DeepCopyPointerClasses()
606 else if (to->proximity) { in DeepCopyPointerClasses()
607 classes = to->unused_classes; in DeepCopyPointerClasses()
608 classes->proximity = to->proximity; in DeepCopyPointerClasses()
609 to->proximity = NULL; in DeepCopyPointerClasses()
612 if (from->touch) { in DeepCopyPointerClasses()
615 if (!to->touch) { in DeepCopyPointerClasses()
616 classes = to->unused_classes; in DeepCopyPointerClasses()
617 to->touch = classes->touch; in DeepCopyPointerClasses()
618 if (!to->touch) { in DeepCopyPointerClasses()
621 to->touch = calloc(1, sizeof(TouchClassRec)); in DeepCopyPointerClasses()
622 if (!to->touch) in DeepCopyPointerClasses()
624 to->touch->num_touches = from->touch->num_touches; in DeepCopyPointerClasses()
625 to->touch->touches = calloc(to->touch->num_touches, in DeepCopyPointerClasses()
627 for (i = 0; i < to->touch->num_touches; i++) in DeepCopyPointerClasses()
628 TouchInitTouchPoint(to->touch, to->valuator, i); in DeepCopyPointerClasses()
629 if (!to->touch) in DeepCopyPointerClasses()
633 classes->touch = NULL; in DeepCopyPointerClasses()
636 t = to->touch; in DeepCopyPointerClasses()
637 f = from->touch; in DeepCopyPointerClasses()
638 t->sourceid = f->sourceid; in DeepCopyPointerClasses()
639 t->max_touches = f->max_touches; in DeepCopyPointerClasses()
640 t->mode = f->mode; in DeepCopyPointerClasses()
641 t->buttonsDown = f->buttonsDown; in DeepCopyPointerClasses()
642 t->state = f->state; in DeepCopyPointerClasses()
643 t->motionMask = f->motionMask; in DeepCopyPointerClasses()
644 /* to->touches and to->num_touches are separate on the master, in DeepCopyPointerClasses()
647 /* Don't remove touch class if from->touch is non-existent. The to device in DeepCopyPointerClasses()
648 * may have an active touch grab, so we need to keep the touch class record in DeepCopyPointerClasses()
669 if ((dce->flags & DEVCHANGE_KEYBOARD_EVENT)) in DeepCopyDeviceClasses()
671 if ((dce->flags & DEVCHANGE_POINTER_EVENT)) in DeepCopyDeviceClasses()
688 ErrorF("[Xi] event conversion from DCE failed with code %d\n", rc); in XISendDeviceChangedEvent()
693 * later when event is delivered. */ in XISendDeviceChangedEvent()
708 rc = dixLookupDevice(&slave, dce->sourceid, serverClient, DixReadAccess); in ChangeMasterDeviceClasses()
717 return; /* set floating since the event */ in ChangeMasterDeviceClasses()
719 if (GetMaster(slave, MASTER_ATTACHED)->id != dce->masterid) in ChangeMasterDeviceClasses()
724 device->public.devicePrivate = slave->public.devicePrivate; in ChangeMasterDeviceClasses()
726 /* FIXME: the classes may have changed since we generated the event. */ in ChangeMasterDeviceClasses()
728 dce->deviceid = device->id; in ChangeMasterDeviceClasses()
733 * Add state and motionMask to the filter for this event. The protocol
750 SetMaskForEvent(device->id, mask, DeviceMotionNotify); in UpdateDeviceMotionMask()
752 SetMaskForEvent(device->id, mask, MotionNotify); in UpdateDeviceMotionMask()
759 if (dev->valuator) in IncreaseButtonCount()
760 dev->valuator->motionHintWindow = NullWindow; in IncreaseButtonCount()
764 if (dev->button->map[key] <= 5) in IncreaseButtonCount()
765 *state |= (Button1Mask >> 1) << dev->button->map[key]; in IncreaseButtonCount()
772 if (dev->valuator) in DecreaseButtonCount()
773 dev->valuator->motionHintWindow = NullWindow; in DecreaseButtonCount()
775 if (*buttons_down >= 1 && !--(*buttons_down)) in DecreaseButtonCount()
777 if (dev->button->map[key] <= 5) in DecreaseButtonCount()
778 *state &= ~((Button1Mask >> 1) << dev->button->map[key]); in DecreaseButtonCount()
782 * Update the device state according to the data in the event.
791 UpdateDeviceState(DeviceIntPtr device, DeviceEvent *event) in UpdateDeviceState() argument
801 /* This event is always the first we get, before the actual events with in UpdateDeviceState()
803 * actually be the slave device that caused the event. in UpdateDeviceState()
805 switch (event->type) { in UpdateDeviceState()
807 ChangeMasterDeviceClasses(device, (DeviceChangedEvent *) event); in UpdateDeviceState()
808 return DONT_PROCESS; /* event has been sent already */ in UpdateDeviceState()
825 k = device->key; in UpdateDeviceState()
826 v = device->valuator; in UpdateDeviceState()
827 b = device->button; in UpdateDeviceState()
828 t = device->touch; in UpdateDeviceState()
830 key = event->detail.key; in UpdateDeviceState()
834 last_valuator = -1; in UpdateDeviceState()
836 if (BitIsOn(&event->valuators.mask, i)) { in UpdateDeviceState()
838 ErrorF("[Xi] Valuators reported for non-valuator device '%s'. " in UpdateDeviceState()
839 "Ignoring event.\n", device->name); in UpdateDeviceState()
842 else if (v->numAxes < i) { in UpdateDeviceState()
844 "Ignoring event.\n", device->name); in UpdateDeviceState()
851 for (i = 0; i <= last_valuator && i < v->numAxes; i++) { in UpdateDeviceState()
853 if (BitIsOn(&event->valuators.mask, i)) in UpdateDeviceState()
854 v->axisVal[i] = event->valuators.data[i]; in UpdateDeviceState()
857 if (event->type == ET_KeyPress) { in UpdateDeviceState()
862 if (key_is_down(device, key, KEY_PROCESSED) && !event->key_repeat) in UpdateDeviceState()
865 if (device->valuator) in UpdateDeviceState()
866 device->valuator->motionHintWindow = NullWindow; in UpdateDeviceState()
869 else if (event->type == ET_KeyRelease) { in UpdateDeviceState()
875 if (device->valuator) in UpdateDeviceState()
876 device->valuator->motionHintWindow = NullWindow; in UpdateDeviceState()
879 else if (event->type == ET_ButtonPress) { in UpdateDeviceState()
888 if (!b->map[key]) in UpdateDeviceState()
891 IncreaseButtonCount(device, key, &b->buttonsDown, &b->motionMask, in UpdateDeviceState()
892 &b->state); in UpdateDeviceState()
893 UpdateDeviceMotionMask(device, b->state, b->motionMask); in UpdateDeviceState()
895 else if (event->type == ET_ButtonRelease) { in UpdateDeviceState()
907 * event being delivered through the slave first in UpdateDeviceState()
909 for (sd = inputInfo.devices; sd; sd = sd->next) { in UpdateDeviceState()
912 if (!sd->button) in UpdateDeviceState()
914 for (i = 1; i <= sd->button->numButtons; i++) in UpdateDeviceState()
915 if (sd->button->map[i] == key && in UpdateDeviceState()
921 if (!b->map[key]) in UpdateDeviceState()
924 DecreaseButtonCount(device, key, &b->buttonsDown, &b->motionMask, in UpdateDeviceState()
925 &b->state); in UpdateDeviceState()
926 UpdateDeviceMotionMask(device, b->state, b->motionMask); in UpdateDeviceState()
928 else if (event->type == ET_ProximityIn) in UpdateDeviceState()
929 device->proximity->in_proximity = TRUE; in UpdateDeviceState()
930 else if (event->type == ET_ProximityOut) in UpdateDeviceState()
931 device->proximity->in_proximity = FALSE; in UpdateDeviceState()
932 else if (event->type == ET_TouchBegin) { in UpdateDeviceState()
936 if (!b->map[key]) in UpdateDeviceState()
939 if (!(event->flags & TOUCH_POINTER_EMULATED) || in UpdateDeviceState()
940 (event->flags & TOUCH_REPLAYING)) in UpdateDeviceState()
943 IncreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask, in UpdateDeviceState()
944 &t->state); in UpdateDeviceState()
945 UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask); in UpdateDeviceState()
947 else if (event->type == ET_TouchEnd) { in UpdateDeviceState()
951 if (t->buttonsDown <= 0 || !b->map[key]) in UpdateDeviceState()
954 if (!(event->flags & TOUCH_POINTER_EMULATED)) in UpdateDeviceState()
957 DecreaseButtonCount(device, key, &t->buttonsDown, &t->motionMask, in UpdateDeviceState()
958 &t->state); in UpdateDeviceState()
959 UpdateDeviceMotionMask(device, t->state, DeviceButtonMotionMask); in UpdateDeviceState()
967 * TouchBegin event if there is at least one grab active.
978 nt_list_for_each_entry(iclient, wOtherInputMasks(win)->inputClients, next) { in TouchClientWantsOwnershipEvents()
982 return xi2mask_isset(iclient->xi2mask, dev, XI_TouchOwnership); in TouchClientWantsOwnershipEvents()
1003 * Attempts to deliver a touch event to the given client.
1012 Window child = DeepestSpriteWin(&ti->sprite)->drawable.id; in DeliverOneTouchEvent()
1014 /* FIXME: owner event handling */ in DeliverOneTouchEvent()
1017 * the current owner of the touch, only pretend we delivered */ in DeliverOneTouchEvent()
1018 if (!grab && ti->num_grabs != 0 && in DeliverOneTouchEvent()
1026 " (%d)\n", dev->name, __func__, err); in DeliverOneTouchEvent()
1028 FixUpEventFromWindow(&ti->sprite, xi2, win, child, FALSE); in DeliverOneTouchEvent()
1035 if (ev->any.type == ET_TouchUpdate && ti->pending_finish) { in DeliverOneTouchEvent()
1036 ev->any.type = ET_TouchEnd; in DeliverOneTouchEvent()
1041 * resource-gone cleanups will update the delivery list anyway. */ in DeliverOneTouchEvent()
1050 GrabPtr grab = ti->listeners[0].grab; in ActivateEarlyAccept()
1052 BUG_RETURN(ti->listeners[0].type != LISTENER_GRAB && in ActivateEarlyAccept()
1053 ti->listeners[0].type != LISTENER_POINTER_GRAB); in ActivateEarlyAccept()
1058 if (TouchAcceptReject(client, dev, XIAcceptTouch, ti->client_id, in ActivateEarlyAccept()
1059 ti->listeners[0].window->drawable.id, &error) != Success) in ActivateEarlyAccept()
1060 ErrorF("[Xi] Failed to accept touch grab after early acceptance.\n"); in ActivateEarlyAccept()
1064 * Find the oldest touch that still has a pointer emulation client.
1066 * Pointer emulation can only be performed for the oldest touch. Otherwise, the
1068 * the next touch to be emulated.
1078 for (i = 0; i < dev->touch->num_touches; i++) { in FindOldestPointerEmulatedTouch()
1079 TouchPointInfoPtr ti = dev->touch->touches + i; in FindOldestPointerEmulatedTouch()
1082 if (!ti->active || !ti->emulate_pointer) in FindOldestPointerEmulatedTouch()
1085 for (j = 0; j < ti->num_listeners; j++) { in FindOldestPointerEmulatedTouch()
1086 if (ti->listeners[j].type == LISTENER_POINTER_GRAB || in FindOldestPointerEmulatedTouch()
1087 ti->listeners[j].type == LISTENER_POINTER_REGULAR) in FindOldestPointerEmulatedTouch()
1090 if (j == ti->num_listeners) in FindOldestPointerEmulatedTouch()
1098 if (oldest->client_id - ti->client_id < UINT_MAX / 2) in FindOldestPointerEmulatedTouch()
1106 * If the current owner has rejected the event, deliver the
1113 TouchListener *listener = &ti->listeners[0]; /* new owner */ in TouchPuntToNextOwner()
1114 int accepted_early = listener->state == LISTENER_EARLY_ACCEPT; in TouchPuntToNextOwner()
1117 if (listener->state == LISTENER_AWAITING_OWNER || accepted_early) in TouchPuntToNextOwner()
1119 listener->listener); in TouchPuntToNextOwner()
1120 else if (listener->state == LISTENER_AWAITING_BEGIN) { in TouchPuntToNextOwner()
1123 if ((listener->type == LISTENER_POINTER_GRAB || in TouchPuntToNextOwner()
1124 listener->type == LISTENER_POINTER_REGULAR) && in TouchPuntToNextOwner()
1128 TouchEventHistoryReplay(ti, dev, listener->listener); in TouchPuntToNextOwner()
1131 /* New owner has Begin/Update but not end. If touch is pending_finish, in TouchPuntToNextOwner()
1133 if (ti->pending_finish) { in TouchPuntToNextOwner()
1136 /* If the last owner is not a touch grab, finalise the touch, we in TouchPuntToNextOwner()
1139 if (ti->num_listeners == 1 && in TouchPuntToNextOwner()
1140 (ti->num_grabs == 0 || in TouchPuntToNextOwner()
1141 listener->grab->grabtype != XI2 || in TouchPuntToNextOwner()
1142 !xi2mask_isset(listener->grab->xi2mask, dev, XI_TouchBegin))) { in TouchPuntToNextOwner()
1153 * Check the oldest touch to see if it needs to be replayed to its pointer
1156 * Touch event propagation is paused if it hits a pointer listener while an
1157 * older touch with a pointer listener is waiting on accept or reject. This
1158 * function will restart propagation of a paused touch if needed.
1167 if (oldest && oldest->listeners[0].state == LISTENER_AWAITING_BEGIN) in CheckOldestTouch()
1172 * Process a touch rejection.
1174 * @param sourcedev The source device of the touch sequence.
1176 * @param resource The resource of the client rejecting the touch.
1177 * @param ev TouchOwnership event to send. Set to NULL if no event should be
1184 Bool was_owner = (resource == ti->listeners[0].listener); in TouchRejected()
1187 /* Send a TouchEnd event to the resource being removed, but only if they in TouchRejected()
1189 for (i = 0; i < ti->num_listeners; i++) { in TouchRejected()
1190 if (ti->listeners[i].listener == resource) { in TouchRejected()
1191 if (ti->listeners[i].state != LISTENER_HAS_END) in TouchRejected()
1198 * ti->num_listeners, as well as ti->num_grabs if it was a grab. */ in TouchRejected()
1202 * the TouchOwnership or TouchBegin event to the new owner. */ in TouchRejected()
1203 if (ev && ti->num_listeners > 0 && was_owner) in TouchRejected()
1205 else if (ti->num_listeners == 0) in TouchRejected()
1212 * Processes a TouchOwnership event, indicating a grab has accepted the touch
1215 * well as possibly sending the new TouchOwnership event. May end the
1222 TouchPointInfoPtr ti = TouchFindByClientID(dev, ev->touchid); in ProcessTouchOwnershipEvent()
1225 DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n", in ProcessTouchOwnershipEvent()
1226 dev->name, ev->type, ev->touchid); in ProcessTouchOwnershipEvent()
1230 if (ev->reason == XIRejectTouch) in ProcessTouchOwnershipEvent()
1231 TouchRejected(dev, ti, ev->resource, ev); in ProcessTouchOwnershipEvent()
1232 else if (ev->reason == XIAcceptTouch) { in ProcessTouchOwnershipEvent()
1236 /* For pointer-emulated listeners that ungrabbed the active grab, in ProcessTouchOwnershipEvent()
1238 * through the motions of ending the touch if the listener has in ProcessTouchOwnershipEvent()
1239 * already seen the end. This ensures that the touch record is ended in in ProcessTouchOwnershipEvent()
1242 if (ti->listeners[0].state == LISTENER_HAS_END) in ProcessTouchOwnershipEvent()
1243 TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[0].listener); in ProcessTouchOwnershipEvent()
1245 /* The touch owner has accepted the touch. Send TouchEnd events to in ProcessTouchOwnershipEvent()
1247 for (i = 1; i < ti->num_listeners; i++) in ProcessTouchOwnershipEvent()
1248 TouchEmitTouchEnd(dev, ti, TOUCH_ACCEPT, ti->listeners[i].listener); in ProcessTouchOwnershipEvent()
1250 while (ti->num_listeners > 1) in ProcessTouchOwnershipEvent()
1251 TouchRemoveListener(ti, ti->listeners[1].listener); in ProcessTouchOwnershipEvent()
1253 if (ti->listeners[0].state == LISTENER_HAS_END) in ProcessTouchOwnershipEvent()
1256 ti->listeners[0].state = LISTENER_HAS_ACCEPTED; in ProcessTouchOwnershipEvent()
1258 else { /* this is the very first ownership event for a grab */ in ProcessTouchOwnershipEvent()
1259 DeliverTouchEvents(dev, ti, (InternalEvent *) ev, ev->resource); in ProcessTouchOwnershipEvent()
1264 * Copy the event's valuator information into the touchpoint, we may need
1272 for (i = 0; i < ARRAY_SIZE(ev->valuators.data); i++) in TouchCopyValuatorData()
1273 if (BitIsOn(ev->valuators.mask, i)) in TouchCopyValuatorData()
1274 valuator_mask_set_double(ti->valuators, i, ev->valuators.data[i]); in TouchCopyValuatorData()
1278 * Given a touch event and a potential listener, retrieve info needed for
1279 * processing the event.
1281 * @param dev The device generating the touch event.
1282 * @param ti The touch point info record for the touch event.
1283 * @param ev The touch event to process.
1284 * @param listener The touch event listener that may receive the touch event.
1285 * @param[out] client The client that should receive the touch event.
1286 * @param[out] win The window to deliver the event on.
1287 * @param[out] grab The grab to deliver the event through, if any.
1288 * @param[out] mask The XI 2.x event mask of the grab or selection, if any.
1289 * @return TRUE if an event should be delivered to the listener, FALSE
1302 if (listener->type == LISTENER_GRAB || in RetrieveTouchDeliveryData()
1303 listener->type == LISTENER_POINTER_GRAB) { in RetrieveTouchDeliveryData()
1304 *grab = listener->grab; in RetrieveTouchDeliveryData()
1309 *win = (*grab)->window; in RetrieveTouchDeliveryData()
1310 *mask = (*grab)->xi2mask; in RetrieveTouchDeliveryData()
1313 rc = dixLookupResourceByType((void **) win, listener->listener, in RetrieveTouchDeliveryData()
1314 listener->resource_type, in RetrieveTouchDeliveryData()
1319 if (listener->level == XI2) { in RetrieveTouchDeliveryData()
1322 if (ti->emulate_pointer && in RetrieveTouchDeliveryData()
1323 listener->type == LISTENER_POINTER_REGULAR) in RetrieveTouchDeliveryData()
1326 evtype = GetXI2Type(ev->any.type); in RetrieveTouchDeliveryData()
1329 wOtherInputMasks(*win)->inputClients, next) in RetrieveTouchDeliveryData()
1330 if (xi2mask_isset(iclients->xi2mask, dev, evtype)) in RetrieveTouchDeliveryData()
1335 *mask = iclients->xi2mask; in RetrieveTouchDeliveryData()
1338 else if (listener->level == XI) { in RetrieveTouchDeliveryData()
1343 wOtherInputMasks(*win)->inputClients, next) in RetrieveTouchDeliveryData()
1344 if (iclients->mask[dev->id] & xi_filter) in RetrieveTouchDeliveryData()
1358 if (oclients->mask & core_filter) in RetrieveTouchDeliveryData()
1384 grab = dev->deviceGrab.grab; in DeliverTouchEmulatedEvent()
1386 win = grab->window; in DeliverTouchEmulatedEvent()
1387 xi2mask = grab->xi2mask; in DeliverTouchEmulatedEvent()
1392 /* We don't deliver pointer events to non-owners */ in DeliverTouchEmulatedEvent()
1393 if (!TouchResourceIsOwner(ti, listener->listener)) in DeliverTouchEmulatedEvent()
1396 if (!ti->emulate_pointer) in DeliverTouchEmulatedEvent()
1406 event_set_state(dev, kbd, &ptrev->device_event); in DeliverTouchEmulatedEvent()
1407 ptrev->device_event.corestate = event_get_corestate(dev, kbd); in DeliverTouchEmulatedEvent()
1410 /* this side-steps the usual activation mechanisms, but... */ in DeliverTouchEmulatedEvent()
1411 if (ev->any.type == ET_TouchBegin && !dev->deviceGrab.grab) in DeliverTouchEmulatedEvent()
1412 ActivatePassiveGrab(dev, grab, ptrev, ev); /* also delivers the event */ in DeliverTouchEmulatedEvent()
1418 if (!dev->deviceGrab.grab) in DeliverTouchEmulatedEvent()
1421 if (grab->ownerEvents) { in DeliverTouchEmulatedEvent()
1423 WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite); in DeliverTouchEmulatedEvent()
1429 deliveries = DeliverOneGrabbedEvent(ptrev, dev, grab->grabtype); in DeliverTouchEmulatedEvent()
1431 /* We must accept the touch sequence once a pointer listener has in DeliverTouchEmulatedEvent()
1432 * received one event past ButtonPress. */ in DeliverTouchEmulatedEvent()
1433 if (deliveries && ev->any.type != ET_TouchBegin && in DeliverTouchEmulatedEvent()
1434 !(ev->device_event.flags & TOUCH_CLIENT_ID)) in DeliverTouchEmulatedEvent()
1437 if (ev->any.type == ET_TouchEnd && in DeliverTouchEmulatedEvent()
1438 ti->num_listeners == 1 && in DeliverTouchEmulatedEvent()
1439 !dev->button->buttonsDown && in DeliverTouchEmulatedEvent()
1440 dev->deviceGrab.fromPassiveGrab && GrabIsPointerGrab(grab)) { in DeliverTouchEmulatedEvent()
1441 (*dev->deviceGrab.DeactivateGrab) (dev); in DeliverTouchEmulatedEvent()
1448 GrabPtr devgrab = dev->deviceGrab.grab; in DeliverTouchEmulatedEvent()
1449 WindowPtr sprite_win = DeepestSpriteWin(dev->spriteInfo->sprite); in DeliverTouchEmulatedEvent()
1453 * Implicit passive grab activated in response to this event. Store in DeliverTouchEmulatedEvent()
1454 * the event. in DeliverTouchEmulatedEvent()
1456 if (!devgrab && dev->deviceGrab.grab && dev->deviceGrab.implicitGrab) { in DeliverTouchEmulatedEvent()
1460 devgrab = dev->deviceGrab.grab; in DeliverTouchEmulatedEvent()
1464 *dev->deviceGrab.sync.event = ev->device_event; in DeliverTouchEmulatedEvent()
1466 /* The listener array has a sequence of grabs and then one event in DeliverTouchEmulatedEvent()
1468 * event selection. Thus, we update the last listener in the array. in DeliverTouchEmulatedEvent()
1470 l = &ti->listeners[ti->num_listeners - 1]; in DeliverTouchEmulatedEvent()
1471 l->listener = g->resource; in DeliverTouchEmulatedEvent()
1472 l->grab = g; in DeliverTouchEmulatedEvent()
1473 //l->resource_type = RT_NONE; in DeliverTouchEmulatedEvent()
1475 if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin) in DeliverTouchEmulatedEvent()
1476 l->type = LISTENER_POINTER_GRAB; in DeliverTouchEmulatedEvent()
1478 l->type = LISTENER_GRAB; in DeliverTouchEmulatedEvent()
1482 if (ev->any.type == ET_TouchBegin) in DeliverTouchEmulatedEvent()
1483 listener->state = LISTENER_IS_OWNER; in DeliverTouchEmulatedEvent()
1484 else if (ev->any.type == ET_TouchEnd) in DeliverTouchEmulatedEvent()
1485 listener->state = LISTENER_HAS_END; in DeliverTouchEmulatedEvent()
1496 if (ti->num_listeners) { in DeliverEmulatedMotionEvent()
1502 if (ti->listeners[0].type != LISTENER_POINTER_REGULAR && in DeliverEmulatedMotionEvent()
1503 ti->listeners[0].type != LISTENER_POINTER_GRAB) in DeliverEmulatedMotionEvent()
1506 motion = ev->device_event; in DeliverEmulatedMotionEvent()
1511 &ti->listeners[0], &client, &win, &grab, in DeliverEmulatedMotionEvent()
1515 DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client, in DeliverEmulatedMotionEvent()
1532 * TouchEnd event.
1535 * spec for more information), this implements its own grab and event-selection
1541 TouchClassPtr t = dev->touch; in ProcessTouchEvent()
1544 int type = ev->any.type; in ProcessTouchEvent()
1545 int emulate_pointer = ! !(ev->device_event.flags & TOUCH_POINTER_EMULATED); in ProcessTouchEvent()
1551 touchid = ev->device_event.touchid; in ProcessTouchEvent()
1553 if (type == ET_TouchBegin && !(ev->device_event.flags & TOUCH_REPLAYING)) { in ProcessTouchEvent()
1554 ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, in ProcessTouchEvent()
1561 if (emulate_pointer && dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab && in ProcessTouchEvent()
1562 (dev->deviceGrab.grab->grabtype == CORE || in ProcessTouchEvent()
1563 dev->deviceGrab.grab->grabtype == XI || in ProcessTouchEvent()
1564 !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))) in ProcessTouchEvent()
1566 /* Active pointer grab on touch point and we get a TouchEnd - claim this in ProcessTouchEvent()
1573 /* Under the following circumstances we create a new touch record for an in ProcessTouchEvent()
1574 * existing touch: in ProcessTouchEvent()
1576 * - The touch may be pointer emulated in ProcessTouchEvent()
1577 * - An explicit grab is active on the device in ProcessTouchEvent()
1578 * - The grab is a pointer grab in ProcessTouchEvent()
1581 * active touch. in ProcessTouchEvent()
1583 ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid, in ProcessTouchEvent()
1588 dev->name, touchid); in ProcessTouchEvent()
1598 DebugF("[Xi] %s: Failed to get event %d for touchpoint %d\n", in ProcessTouchEvent()
1599 dev->name, type, touchid); in ProcessTouchEvent()
1603 /* if emulate_pointer is set, emulate the motion event right in ProcessTouchEvent()
1604 * here, so we can ignore it for button event emulation. TouchUpdate in ProcessTouchEvent()
1606 if (emulate_pointer && ev->any.type != ET_TouchUpdate) in ProcessTouchEvent()
1610 CheckMotion(&ev->device_event, dev); in ProcessTouchEvent()
1613 event_set_state(NULL, kbd, &ev->device_event); in ProcessTouchEvent()
1614 ev->device_event.corestate = event_get_corestate(NULL, kbd); in ProcessTouchEvent()
1616 /* Make sure we have a valid window trace for event delivery; must be in ProcessTouchEvent()
1617 * called after event type mutation. Touch end events are always processed in ProcessTouchEvent()
1618 * in order to end touch records. */ in ProcessTouchEvent()
1621 !(ev->device_event.flags & TOUCH_REPLAYING) && in ProcessTouchEvent()
1623 (type != ET_TouchEnd && ti->sprite.spriteTraceGood == 0)) in ProcessTouchEvent()
1626 TouchCopyValuatorData(&ev->device_event, ti); in ProcessTouchEvent()
1627 /* WARNING: the event type may change to TouchUpdate in in ProcessTouchEvent()
1630 DeliverTouchEvents(dev, ti, ev, ev->device_event.resource); in ProcessTouchEvent()
1631 if (ev->any.type == ET_TouchEnd) in ProcessTouchEvent()
1636 UpdateDeviceState(dev, &ev->device_event); in ProcessTouchEvent()
1644 BarrierEvent *be = &e->barrier_event; in ProcessBarrierEvent()
1647 GrabPtr grab = dev->deviceGrab.grab; in ProcessBarrierEvent()
1652 if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success) in ProcessBarrierEvent()
1656 be->flags |= XIBarrierDeviceIsGrabbed; in ProcessBarrierEvent()
1660 ErrorF("[Xi] event conversion from %s failed with code %d\n", __func__, rc); in ProcessBarrierEvent()
1670 CLIENT_ID(be->barrierid) == CLIENT_ID(grab->resource) && in ProcessBarrierEvent()
1671 grab->window->drawable.id == be->window) { in ProcessBarrierEvent()
1695 DeviceEvent *event = &ev->device_event; in ProcessDeviceEvent() local
1700 if (!kbd->key) /* can happen with floating SDs */ in ProcessDeviceEvent()
1706 if (!mouse->valuator || !mouse->button) /* may be float. SDs */ in ProcessDeviceEvent()
1711 event_set_state(mouse, kbd, event); in ProcessDeviceEvent()
1713 ret = UpdateDeviceState(device, event); in ProcessDeviceEvent()
1717 b = device->button; in ProcessDeviceEvent()
1720 CheckMotion(event, device); in ProcessDeviceEvent()
1722 switch (event->type) { in ProcessDeviceEvent()
1731 event->root_x = rootX; in ProcessDeviceEvent()
1732 event->root_y = rootY; in ProcessDeviceEvent()
1733 NoticeEventTime((InternalEvent *) event, device); in ProcessDeviceEvent()
1734 event->corestate = corestate; in ProcessDeviceEvent()
1735 key = event->detail.key; in ProcessDeviceEvent()
1743 (event->type == ET_KeyPress || event->type == ET_KeyRelease)) { in ProcessDeviceEvent()
1755 SpritePtr pSprite = device->spriteInfo->sprite; in ProcessDeviceEvent()
1758 if (ev->any.type == ET_Motion) in ProcessDeviceEvent()
1759 ev->device_event.root = pSprite->hotPhys.pScreen->root->drawable.id; in ProcessDeviceEvent()
1762 eventinfo.event = ev; in ProcessDeviceEvent()
1766 grab = device->deviceGrab.grab; in ProcessDeviceEvent()
1768 switch (event->type) { in ProcessDeviceEvent()
1772 if (event->source_type == EVENT_SOURCE_FOCUS) in ProcessDeviceEvent()
1774 if (!grab && CheckDeviceGrabs(device, event, 0)) in ProcessDeviceEvent()
1778 if (grab && device->deviceGrab.fromPassiveGrab && in ProcessDeviceEvent()
1779 (key == device->deviceGrab.activatingKey) && in ProcessDeviceEvent()
1780 GrabIsKeyboardGrab(device->deviceGrab.grab)) in ProcessDeviceEvent()
1784 if (b->map[key] == 0) /* there's no button 0 */ in ProcessDeviceEvent()
1786 event->detail.button = b->map[key]; in ProcessDeviceEvent()
1787 if (!grab && CheckDeviceGrabs(device, event, 0)) { in ProcessDeviceEvent()
1788 /* if a passive grab was activated, the event has been sent in ProcessDeviceEvent()
1794 if (b->map[key] == 0) /* there's no button 0 */ in ProcessDeviceEvent()
1796 event->detail.button = b->map[key]; in ProcessDeviceEvent()
1797 if (grab && !b->buttonsDown && in ProcessDeviceEvent()
1798 device->deviceGrab.fromPassiveGrab && in ProcessDeviceEvent()
1799 GrabIsPointerGrab(device->deviceGrab.grab)) in ProcessDeviceEvent()
1807 if (event->source_type != EVENT_SOURCE_FOCUS) { in ProcessDeviceEvent()
1809 DeliverGrabbedEvent((InternalEvent *) event, device, in ProcessDeviceEvent()
1811 else if (device->focus && !IsPointerEvent(ev)) in ProcessDeviceEvent()
1812 DeliverFocusedEvent(device, (InternalEvent *) event, in ProcessDeviceEvent()
1815 DeliverDeviceEvents(GetSpriteWindow(device), (InternalEvent *) event, in ProcessDeviceEvent()
1820 (*device->deviceGrab.DeactivateGrab) (device); in ProcessDeviceEvent()
1838 event->detail.key = key; in ProcessDeviceEvent()
1842 * Main device event processing function.
1843 * Called from when processing the events from the event queue.
1851 switch (ev->any.type) { in ProcessOtherEvent()
1860 DeliverRawEvent(&ev->raw_event, device); in ProcessOtherEvent()
1870 ProcessTouchOwnershipEvent(&ev->touch_ownership_event, device); in ProcessOtherEvent()
1892 if (listener->type == LISTENER_POINTER_REGULAR || in DeliverTouchBeginEvent()
1893 listener->type == LISTENER_POINTER_GRAB) { in DeliverTouchBeginEvent()
1897 listener->state = LISTENER_IS_OWNER; in DeliverTouchBeginEvent()
1898 /* async grabs cannot replay, so automatically accept this touch */ in DeliverTouchBeginEvent()
1899 if (listener->type == LISTENER_POINTER_GRAB && in DeliverTouchBeginEvent()
1900 dev->deviceGrab.grab && in DeliverTouchBeginEvent()
1901 dev->deviceGrab.fromPassiveGrab && in DeliverTouchBeginEvent()
1902 dev->deviceGrab.grab->pointerMode == GrabModeAsync) in DeliverTouchBeginEvent()
1910 if (TouchResourceIsOwner(ti, listener->listener) || has_ownershipmask) in DeliverTouchBeginEvent()
1912 if (!TouchResourceIsOwner(ti, listener->listener)) { in DeliverTouchBeginEvent()
1920 TouchSendOwnershipEvent(dev, ti, 0, listener->listener); in DeliverTouchBeginEvent()
1922 if (listener->type == LISTENER_REGULAR) in DeliverTouchBeginEvent()
1927 listener->state = state; in DeliverTouchBeginEvent()
1940 if (listener->type == LISTENER_POINTER_REGULAR || in DeliverTouchEndEvent()
1941 listener->type == LISTENER_POINTER_GRAB) { in DeliverTouchEndEvent()
1944 * actually send the event. in DeliverTouchEndEvent()
1947 if (listener->state != LISTENER_HAS_END) { in DeliverTouchEndEvent()
1953 * GrabModeSync + replay. This listener now gets the end event, in DeliverTouchEndEvent()
1957 listener->state = LISTENER_HAS_END; in DeliverTouchEndEvent()
1963 if (listener->state == LISTENER_AWAITING_BEGIN) { in DeliverTouchEndEvent()
1964 listener->state = LISTENER_HAS_END; in DeliverTouchEndEvent()
1968 /* Event in response to reject */ in DeliverTouchEndEvent()
1969 if (ev->device_event.flags & TOUCH_REJECT || in DeliverTouchEndEvent()
1970 (ev->device_event.flags & TOUCH_ACCEPT && !TouchResourceIsOwner(ti, listener->listener))) { in DeliverTouchEndEvent()
1971 /* Touch has been rejected, or accepted by its owner which is not this listener */ in DeliverTouchEndEvent()
1972 if (listener->state != LISTENER_HAS_END) in DeliverTouchEndEvent()
1974 listener->state = LISTENER_HAS_END; in DeliverTouchEndEvent()
1976 else if (TouchResourceIsOwner(ti, listener->listener)) { in DeliverTouchEndEvent()
1977 Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT); in DeliverTouchEndEvent()
1980 if (normal_end && listener->state != LISTENER_HAS_END) in DeliverTouchEndEvent()
1983 if ((ti->num_listeners > 1 || in DeliverTouchEndEvent()
1984 (ti->num_grabs > 0 && listener->state != LISTENER_HAS_ACCEPTED)) && in DeliverTouchEndEvent()
1985 (ev->device_event.flags & (TOUCH_ACCEPT | TOUCH_REJECT)) == 0) { in DeliverTouchEndEvent()
1986 ev->any.type = ET_TouchUpdate; in DeliverTouchEndEvent()
1987 ev->device_event.flags |= TOUCH_PENDING_END; in DeliverTouchEndEvent()
1988 ti->pending_finish = TRUE; in DeliverTouchEndEvent()
1990 if (normal_end && listener->state != LISTENER_HAS_END) in DeliverTouchEndEvent()
1995 listener->state = LISTENER_HAS_END; in DeliverTouchEndEvent()
2013 if (ev->any.type == ET_TouchOwnership) { in DeliverTouchEvent()
2014 ev->touch_ownership_event.deviceid = dev->id; in DeliverTouchEvent()
2015 if (!TouchResourceIsOwner(ti, listener->listener)) in DeliverTouchEvent()
2018 listener->state = LISTENER_IS_OWNER; in DeliverTouchEvent()
2021 ev->device_event.deviceid = dev->id; in DeliverTouchEvent()
2023 if (ev->any.type == ET_TouchBegin) { in DeliverTouchEvent()
2027 else if (ev->any.type == ET_TouchUpdate) { in DeliverTouchEvent()
2028 if (listener->type == LISTENER_POINTER_REGULAR || in DeliverTouchEvent()
2029 listener->type == LISTENER_POINTER_GRAB) in DeliverTouchEvent()
2032 else if (TouchResourceIsOwner(ti, listener->listener) || in DeliverTouchEvent()
2036 else if (ev->any.type == ET_TouchEnd) in DeliverTouchEvent()
2045 * Delivers a touch events to all interested clients. For TouchBegin events,
2046 * will update ti->listeners, ti->num_listeners, and ti->num_grabs.
2048 * @resource is non-zero, will only attempt delivery to the owner of that
2051 * @return TRUE if the event was delivered at least once, FALSE otherwise
2059 if (ev->any.type == ET_TouchBegin && in DeliverTouchEvents()
2060 !(ev->device_event.flags & (TOUCH_CLIENT_ID | TOUCH_REPLAYING))) in DeliverTouchEvents()
2063 TouchEventHistoryPush(ti, &ev->device_event); in DeliverTouchEvents()
2065 for (i = 0; i < ti->num_listeners; i++) { in DeliverTouchEvents()
2070 TouchListener *listener = &ti->listeners[i]; in DeliverTouchEvents()
2072 if (resource && listener->listener != resource) in DeliverTouchEvents()
2089 BUG_RETURN_VAL(dev->proximity != NULL, FALSE); in InitProximityClassDeviceStruct()
2094 proxc->sourceid = dev->id; in InitProximityClassDeviceStruct()
2095 proxc->in_proximity = TRUE; in InitProximityClassDeviceStruct()
2096 dev->proximity = proxc; in InitProximityClassDeviceStruct()
2117 BUG_RETURN_VAL(dev->valuator == NULL, FALSE); in InitValuatorAxisStruct()
2118 BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE); in InitValuatorAxisStruct()
2121 ax = dev->valuator->axes + axnum; in InitValuatorAxisStruct()
2123 ax->min_value = minval; in InitValuatorAxisStruct()
2124 ax->max_value = maxval; in InitValuatorAxisStruct()
2125 ax->resolution = resolution; in InitValuatorAxisStruct()
2126 ax->min_resolution = min_res; in InitValuatorAxisStruct()
2127 ax->max_resolution = max_res; in InitValuatorAxisStruct()
2128 ax->label = label; in InitValuatorAxisStruct()
2129 ax->mode = mode; in InitValuatorAxisStruct()
2132 dev->proximity->in_proximity = FALSE; in InitValuatorAxisStruct()
2150 BUG_RETURN_VAL(dev->valuator == NULL, FALSE); in SetScrollValuator()
2151 BUG_RETURN_VAL(axnum >= dev->valuator->numAxes, FALSE); in SetScrollValuator()
2155 current_ax = &dev->valuator->v_scroll_axis; in SetScrollValuator()
2158 current_ax = &dev->valuator->h_scroll_axis; in SetScrollValuator()
2161 ax = &dev->valuator->axes[axnum]; in SetScrollValuator()
2162 ax->scroll.type = type; in SetScrollValuator()
2171 if (*current_ax != -1 && axnum != *current_ax) { in SetScrollValuator()
2172 ax = &dev->valuator->axes[*current_ax]; in SetScrollValuator()
2173 if (ax->scroll.type == type && in SetScrollValuator()
2175 (ax->scroll.flags & SCROLL_FLAG_PREFERRED)) in SetScrollValuator()
2180 ax = &dev->valuator->axes[axnum]; in SetScrollValuator()
2181 ax->scroll.type = type; in SetScrollValuator()
2182 ax->scroll.increment = increment; in SetScrollValuator()
2183 ax->scroll.flags = flags; in SetScrollValuator()
2192 * whenever the next slave switch happens anyway. CMDC sends the event in SetScrollValuator()
2194 if (master && master->lastSlave == dev) in SetScrollValuator()
2203 if (param->grabtype != CORE && in CheckGrabValues()
2204 param->grabtype != XI && param->grabtype != XI2) { in CheckGrabValues()
2209 if ((param->this_device_mode != GrabModeSync) && in CheckGrabValues()
2210 (param->this_device_mode != GrabModeAsync) && in CheckGrabValues()
2211 (param->this_device_mode != XIGrabModeTouch)) { in CheckGrabValues()
2212 client->errorValue = param->this_device_mode; in CheckGrabValues()
2215 if ((param->other_devices_mode != GrabModeSync) && in CheckGrabValues()
2216 (param->other_devices_mode != GrabModeAsync) && in CheckGrabValues()
2217 (param->other_devices_mode != XIGrabModeTouch)) { in CheckGrabValues()
2218 client->errorValue = param->other_devices_mode; in CheckGrabValues()
2222 if (param->modifiers != AnyModifier && in CheckGrabValues()
2223 param->modifiers != XIAnyModifier && in CheckGrabValues()
2224 (param->modifiers & ~AllModifiersMask)) { in CheckGrabValues()
2225 client->errorValue = param->modifiers; in CheckGrabValues()
2229 if ((param->ownerEvents != xFalse) && (param->ownerEvents != xTrue)) { in CheckGrabValues()
2230 client->errorValue = param->ownerEvents; in CheckGrabValues()
2244 int rc, type = -1; in GrabButton()
2250 if (param->confineTo == None) in GrabButton()
2253 rc = dixLookupWindow(&confineTo, param->confineTo, client, in GrabButton()
2258 if (param->cursor == None) in GrabButton()
2261 rc = dixLookupResourceByType((void **) &cursor, param->cursor, in GrabButton()
2264 client->errorValue = param->cursor; in GrabButton()
2269 if (param->this_device_mode == GrabModeSync || in GrabButton()
2270 param->other_devices_mode == GrabModeSync) in GrabButton()
2275 rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); in GrabButton()
2284 grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype, in GrabButton()
2301 KeyClassPtr k = dev->key; in GrabKey()
2303 int rc, type = -1; in GrabKey()
2308 if ((dev->id != XIAllDevices && dev->id != XIAllMasterDevices) && k == NULL) in GrabKey()
2311 if ((key > k->xkbInfo->desc->max_key_code || in GrabKey()
2312 key < k->xkbInfo->desc->min_key_code) in GrabKey()
2314 client->errorValue = key; in GrabKey()
2322 rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); in GrabKey()
2325 if (param->this_device_mode == GrabModeSync || in GrabKey()
2326 param->other_devices_mode == GrabModeSync) in GrabKey()
2332 grab = CreateGrab(client->index, dev, modifier_device, pWin, grabtype, in GrabKey()
2354 rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); in GrabWindow()
2357 if (param->cursor == None) in GrabWindow()
2360 rc = dixLookupResourceByType((void **) &cursor, param->cursor, in GrabWindow()
2363 client->errorValue = param->cursor; in GrabWindow()
2368 if (param->this_device_mode == GrabModeSync || in GrabWindow()
2369 param->other_devices_mode == GrabModeSync) in GrabWindow()
2375 grab = CreateGrab(client->index, dev, dev, pWin, XI2, in GrabWindow()
2386 /* Touch grab */
2399 rc = dixLookupWindow(&pWin, param->grabWindow, client, DixSetAttrAccess); in GrabTouch()
2406 grab = CreateGrab(client->index, dev, mod_dev, pWin, XI2, in GrabTouch()
2418 int mskidx = dev->id; in SelectForWindow()
2425 if (check & wOtherInputMasks(pWin)->inputEvents[mskidx]) { in SelectForWindow()
2430 for (others = wOtherInputMasks(pWin)->inputClients; others; in SelectForWindow()
2431 others = others->next) { in SelectForWindow()
2433 others->mask[mskidx])) in SelectForWindow()
2437 for (others = wOtherInputMasks(pWin)->inputClients; others; in SelectForWindow()
2438 others = others->next) { in SelectForWindow()
2440 check = others->mask[mskidx]; in SelectForWindow()
2441 others->mask[mskidx] = mask; in SelectForWindow()
2444 if (i != mskidx && others->mask[i] != 0) in SelectForWindow()
2449 FreeResource(others->resource, RT_NONE); in SelectForWindow()
2461 if (dev->valuator) in SelectForWindow()
2462 if ((dev->valuator->motionHintWindow == pWin) && in SelectForWindow()
2464 !(check & DevicePointerMotionHintMask) && !dev->deviceGrab.grab) in SelectForWindow()
2465 dev->valuator->motionHintWindow = NullWindow; in SelectForWindow()
2473 xi2mask_free(&(*other)->xi2mask); in FreeInputClient()
2489 if (!pWin->optional && !MakeWindowOptional(pWin)) in AddExtensionClient()
2494 if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) in AddExtensionClient()
2496 others->xi2mask = xi2mask_new(); in AddExtensionClient()
2497 if (!others->xi2mask) in AddExtensionClient()
2499 others->mask[mskidx] = mask; in AddExtensionClient()
2500 others->resource = FakeClientID(client->index); in AddExtensionClient()
2501 others->next = pWin->optional->inputMasks->inputClients; in AddExtensionClient()
2502 pWin->optional->inputMasks->inputClients = others; in AddExtensionClient()
2503 if (!AddResource(others->resource, RT_INPUTCLIENT, (void *) pWin)) in AddExtensionClient()
2520 imasks->xi2mask = xi2mask_new(); in MakeInputMasks()
2521 if (!imasks->xi2mask) { in MakeInputMasks()
2525 pWin->optional->inputMasks = imasks; in MakeInputMasks()
2532 xi2mask_free(&(*imask)->xi2mask); in FreeInputMask()
2548 xi2mask_zero(inputMasks->xi2mask, -1); in RecalculateDeviceDeliverableEvents()
2549 for (others = inputMasks->inputClients; others; in RecalculateDeviceDeliverableEvents()
2550 others = others->next) { in RecalculateDeviceDeliverableEvents()
2552 inputMasks->inputEvents[i] |= others->mask[i]; in RecalculateDeviceDeliverableEvents()
2553 xi2mask_merge(inputMasks->xi2mask, others->xi2mask); in RecalculateDeviceDeliverableEvents()
2556 inputMasks->deliverableEvents[i] = inputMasks->inputEvents[i]; in RecalculateDeviceDeliverableEvents()
2557 for (tmp = pChild->parent; tmp; tmp = tmp->parent) in RecalculateDeviceDeliverableEvents()
2560 inputMasks->deliverableEvents[i] |= in RecalculateDeviceDeliverableEvents()
2561 (wOtherInputMasks(tmp)->deliverableEvents[i] in RecalculateDeviceDeliverableEvents()
2562 & ~inputMasks->dontPropagateMask[i] & in RecalculateDeviceDeliverableEvents()
2565 if (pChild->firstChild) { in RecalculateDeviceDeliverableEvents()
2566 pChild = pChild->firstChild; in RecalculateDeviceDeliverableEvents()
2569 while (!pChild->nextSib && (pChild != pWin)) in RecalculateDeviceDeliverableEvents()
2570 pChild = pChild->parent; in RecalculateDeviceDeliverableEvents()
2573 pChild = pChild->nextSib; in RecalculateDeviceDeliverableEvents()
2585 for (other = wOtherInputMasks(pWin)->inputClients; other; in InputClientGone()
2586 other = other->next) { in InputClientGone()
2587 if (other->resource == id) { in InputClientGone()
2589 prev->next = other->next; in InputClientGone()
2592 else if (!(other->next)) { in InputClientGone()
2596 mask->inputClients = other->next; in InputClientGone()
2598 pWin->optional->inputMasks = (OtherInputMasks *) NULL; in InputClientGone()
2603 other->resource = FakeClientID(0); in InputClientGone()
2604 if (!AddResource(other->resource, RT_INPUTCLIENT, in InputClientGone()
2610 wOtherInputMasks(pWin)->inputClients = other->next; in InputClientGone()
2618 FatalError("client not on device event list"); in InputClientGone()
2622 * Search for window in each touch trace for each device. Remove the window
2631 for (dev = inputInfo.devices; dev; dev = dev->next) { in WindowGone()
2632 TouchClassPtr t = dev->touch; in WindowGone()
2638 for (i = 0; i < t->num_touches; i++) { in WindowGone()
2639 SpritePtr sprite = &t->touches[i].sprite; in WindowGone()
2642 for (j = 0; j < sprite->spriteTraceGood; j++) { in WindowGone()
2643 if (sprite->spriteTrace[j] == win) { in WindowGone()
2644 sprite->spriteTraceGood = j; in WindowGone()
2665 if (!d->focus) in SendEvent()
2668 inputFocus = d->focus->win; in SendEvent()
2671 inputFocus = inputInfo.keyboard->focus->win; in SendEvent()
2676 /* If the input focus is PointerRootWin, send the event to where in SendEvent()
2693 client->errorValue = propagate; in SendEvent()
2696 ev->u.u.type |= 0x80; in SendEvent()
2698 for (; pWin; pWin = pWin->parent) { in SendEvent()
2704 mask &= ~wOtherInputMasks(pWin)->dontPropagateMask[d->id]; in SendEvent()
2718 ButtonClassPtr b = dev->button; in SetButtonMapping()
2723 if (nElts != b->numButtons) { in SetButtonMapping()
2724 client->errorValue = nElts; in SetButtonMapping()
2727 if (BadDeviceMap(&map[0], nElts, 1, 255, &client->errorValue)) in SetButtonMapping()
2730 if ((b->map[i + 1] != map[i]) && BitIsOn(b->down, i + 1)) in SetButtonMapping()
2733 b->map[i + 1] = map[i]; in SetButtonMapping()
2746 KeyClassPtr k = dev->key; in ChangeKeyMapping()
2754 if ((firstKeyCode < k->xkbInfo->desc->min_key_code) || in ChangeKeyMapping()
2755 (firstKeyCode + keyCodes - 1 > k->xkbInfo->desc->max_key_code)) { in ChangeKeyMapping()
2756 client->errorValue = firstKeyCode; in ChangeKeyMapping()
2760 client->errorValue = 0; in ChangeKeyMapping()
2764 keysyms.maxKeyCode = firstKeyCode + keyCodes - 1; in ChangeKeyMapping()
2783 if (dev->deviceGrab.grab && (dev->deviceGrab.grab->window == pWin)) in DeleteDeviceFromAnyExtEvents()
2784 (*dev->deviceGrab.DeactivateGrab) (dev); in DeleteDeviceFromAnyExtEvents()
2789 if (dev->focus && (pWin == dev->focus->win) && (pWin->parent != NullWindow)) { in DeleteDeviceFromAnyExtEvents()
2794 if (dev->deviceGrab.grab) in DeleteDeviceFromAnyExtEvents()
2797 switch (dev->focus->revert) { in DeleteDeviceFromAnyExtEvents()
2801 dev->focus->win = NoneWin; in DeleteDeviceFromAnyExtEvents()
2802 dev->focus->traceGood = 0; in DeleteDeviceFromAnyExtEvents()
2807 parent = parent->parent; in DeleteDeviceFromAnyExtEvents()
2808 dev->focus->traceGood--; in DeleteDeviceFromAnyExtEvents()
2810 while (!parent->realized); in DeleteDeviceFromAnyExtEvents()
2813 dev->focus->win = parent; in DeleteDeviceFromAnyExtEvents()
2814 dev->focus->revert = RevertToNone; in DeleteDeviceFromAnyExtEvents()
2819 dev->focus->win = PointerRootWin; in DeleteDeviceFromAnyExtEvents()
2820 dev->focus->traceGood = 0; in DeleteDeviceFromAnyExtEvents()
2828 if (kbd->focus->win) { in DeleteDeviceFromAnyExtEvents()
2829 if (!ActivateFocusInGrab(dev, pWin, kbd->focus->win)) in DeleteDeviceFromAnyExtEvents()
2830 DoFocusEvents(dev, pWin, kbd->focus->win, focusEventMode); in DeleteDeviceFromAnyExtEvents()
2831 dev->focus->win = FollowKeyboardWin; in DeleteDeviceFromAnyExtEvents()
2832 dev->focus->traceGood = 0; in DeleteDeviceFromAnyExtEvents()
2837 dev->focus->win = NoneWin; in DeleteDeviceFromAnyExtEvents()
2838 dev->focus->traceGood = 0; in DeleteDeviceFromAnyExtEvents()
2845 if (dev->valuator) in DeleteDeviceFromAnyExtEvents()
2846 if (dev->valuator->motionHintWindow == pWin) in DeleteDeviceFromAnyExtEvents()
2847 dev->valuator->motionHintWindow = NullWindow; in DeleteDeviceFromAnyExtEvents()
2858 for (dev = inputInfo.devices; dev; dev = dev->next) { in DeleteWindowFromAnyExtEvents()
2862 for (dev = inputInfo.off_devices; dev; dev = dev->next) in DeleteWindowFromAnyExtEvents()
2867 ic = inputMasks->inputClients; in DeleteWindowFromAnyExtEvents()
2869 inputMasks->dontPropagateMask[i] = 0; in DeleteWindowFromAnyExtEvents()
2870 FreeResource(ic->resource, RT_NONE); in DeleteWindowFromAnyExtEvents()
2879 dixLookupDevice(&dev, pEvents->deviceid & DEVICE_BITS, serverClient, in MaybeSendDeviceMotionNotifyHint()
2884 if (pEvents->type == DeviceMotionNotify) { in MaybeSendDeviceMotionNotifyHint()
2886 if (WID(dev->valuator->motionHintWindow) == pEvents->event) { in MaybeSendDeviceMotionNotifyHint()
2889 pEvents->detail = NotifyHint; in MaybeSendDeviceMotionNotifyHint()
2892 pEvents->detail = NotifyNormal; in MaybeSendDeviceMotionNotifyHint()
2905 dixLookupDevice(&dev, xE->deviceid & DEVICE_BITS, serverClient, in CheckDeviceGrabAndHintWindow()
2911 dev->valuator->motionHintWindow = pWin; in CheckDeviceGrabAndHintWindow()
2920 tempGrab->device = dev; in CheckDeviceGrabAndHintWindow()
2921 tempGrab->resource = client->clientAsMask; in CheckDeviceGrabAndHintWindow()
2922 tempGrab->window = pWin; in CheckDeviceGrabAndHintWindow()
2923 tempGrab->ownerEvents = in CheckDeviceGrabAndHintWindow()
2925 tempGrab->eventMask = deliveryMask; in CheckDeviceGrabAndHintWindow()
2926 tempGrab->keyboardMode = GrabModeAsync; in CheckDeviceGrabAndHintWindow()
2927 tempGrab->pointerMode = GrabModeAsync; in CheckDeviceGrabAndHintWindow()
2928 tempGrab->confineTo = NullWindow; in CheckDeviceGrabAndHintWindow()
2929 tempGrab->cursor = NullCursor; in CheckDeviceGrabAndHintWindow()
2930 tempGrab->next = NULL; in CheckDeviceGrabAndHintWindow()
2931 (*dev->deviceGrab.ActivateGrab) (dev, tempGrab, currentTime, TRUE); in CheckDeviceGrabAndHintWindow()
2943 for (other = wOtherInputMasks(pWin)->inputClients; other; in DeviceEventMaskForClient()
2944 other = other->next) { in DeviceEventMaskForClient()
2946 return other->mask[dev->id]; in DeviceEventMaskForClient()
2955 GrabPtr grab = dev->deviceGrab.grab; in MaybeStopDeviceHint()
2957 pWin = dev->valuator->motionHintWindow; in MaybeStopDeviceHint()
2960 ((grab->eventMask & DevicePointerMotionHintMask) || in MaybeStopDeviceHint()
2961 (grab->ownerEvents && in MaybeStopDeviceHint()
2967 dev->valuator->motionHintWindow = NullWindow; in MaybeStopDeviceHint()
2977 client->errorValue = mask; in DeviceEventSuppressForWindow()
2983 inputMasks->dontPropagateMask[maskndx] = mask; in DeviceEventSuppressForWindow()
2989 inputMasks->dontPropagateMask[maskndx] = mask; in DeviceEventSuppressForWindow()
2993 FreeResource(inputMasks->inputClients->resource, RT_NONE); in DeviceEventSuppressForWindow()
3005 allInputEventMasks |= inputMasks->dontPropagateMask[i]; in ShouldFreeInputMasks()
3008 allInputEventMasks |= inputMasks->inputEvents[i]; in ShouldFreeInputMasks()
3018 * about the Event.
3029 p2 = p1->firstChild; in FindInterestedChildren()
3032 p1 = p1->nextSib; in FindInterestedChildren()
3038 * Send an event to interested clients in all windows on all screens.
3049 pWin = screenInfo.screens[i]->root; in SendEventToAllWindows()
3053 p1 = pWin->firstChild; in SendEventToAllWindows()
3064 * @param mask Event mask in the form of (1 << eventtype)
3075 for (others = wOtherInputMasks(win)->inputClients; others; in XISetEventMask()
3076 others = others->next) { in XISetEventMask()
3078 xi2mask_zero(others->xi2mask, dev->id); in XISetEventMask()
3087 others = wOtherInputMasks(win)->inputClients; in XISetEventMask()
3091 xi2mask_zero(others->xi2mask, dev->id); in XISetEventMask()
3092 len = min(len, xi2mask_mask_size(others->xi2mask)); in XISetEventMask()
3096 xi2mask_set_one_mask(others->xi2mask, dev->id, mask, len); in XISetEventMask()