Lines Matching +full:parent +full:- +full:child

28 #include <dix-config.h>
55 * http://lists.freedesktop.org/archives/xorg/2008-August/037606.html
59 * http://lists.freedesktop.org/archives/xorg/2008-December/041740.html
62 * - The core protocol spec says that "In a LeaveNotify event, if a child of the
63 * event window contains the initial position of the pointer, then the child
64 * component is set to that child. Otherwise, it is None. For an EnterNotify
65 * event, if a child of the event window contains the final pointer position,
66 * then the child component is set to that child. Otherwise, it is None."
71 * - NotifyPointer events may be sent if the focus changes from window A to
82 * Return TRUE if 'win' has a pointer within its boundaries, excluding child
96 if (dev->deviceGrab.grab) in HasPointer()
128 return PointerWindows[dev->id]; in PointerWin()
135 * @return The child window that has the pointer within its boundaries or
155 * @return The child window that has the pointer within its boundaries or
178 PointerWindows[dev->id] = win; in EnterWindow()
187 PointerWindows[dev->id] = NULL; in LeaveWindow()
196 FocusWindows[dev->id] = win; in SetFocusIn()
205 FocusWindows[dev->id] = NULL; in SetFocusOut()
218 for (b = b->parent; b; b = b->parent) in CommonAncestor()
225 * Send enter notifies to all windows between 'ancestor' and 'child' (excluding
232 WindowPtr ancestor, WindowPtr child, int mode, int detail) in DeviceEnterNotifies() argument
234 WindowPtr parent = child->parent; in DeviceEnterNotifies() local
236 if (ancestor == parent) in DeviceEnterNotifies()
238 DeviceEnterNotifies(dev, sourceid, ancestor, parent, mode, detail); in DeviceEnterNotifies()
239 DeviceEnterLeaveEvent(dev, sourceid, XI_Enter, mode, detail, parent, in DeviceEnterNotifies()
240 child->drawable.id); in DeviceEnterNotifies()
244 * Send enter notifies to all windows between 'ancestor' and 'child' (excluding
250 WindowPtr ancestor, WindowPtr child, int mode, int detail) in CoreEnterNotifies() argument
252 WindowPtr parent = child->parent; in CoreEnterNotifies() local
254 if (ancestor == parent) in CoreEnterNotifies()
256 CoreEnterNotifies(dev, ancestor, parent, mode, detail); in CoreEnterNotifies()
273 field is set to the child containing the descendant. The detail in CoreEnterNotifies()
277 if (!HasPointer(dev, parent) && !FirstPointerChild(parent)) in CoreEnterNotifies()
278 CoreEnterLeaveEvent(dev, EnterNotify, mode, detail, parent, in CoreEnterNotifies()
279 child->drawable.id); in CoreEnterNotifies()
284 WindowPtr child, WindowPtr ancestor, int mode, int detail) in CoreLeaveNotifies() argument
288 if (ancestor == child) in CoreLeaveNotifies()
291 for (win = child->parent; win != ancestor; win = win->parent) { in CoreLeaveNotifies()
308 or vice-versa depending on the new P(W). */ in CoreLeaveNotifies()
310 /* If one window has a pointer or a child with a pointer, skip some in CoreLeaveNotifies()
316 child->drawable.id); in CoreLeaveNotifies()
318 child = win; in CoreLeaveNotifies()
323 * Send leave notifies to all windows between 'child' and 'ancestor'.
329 WindowPtr child, WindowPtr ancestor, int mode, int detail) in DeviceLeaveNotifies() argument
333 if (ancestor == child) in DeviceLeaveNotifies()
335 for (win = child->parent; win != ancestor; win = win->parent) { in DeviceLeaveNotifies()
337 child->drawable.id); in DeviceLeaveNotifies()
338 child = win; in DeviceLeaveNotifies()
363 is set to the child containing the new P(W), the detail field in CoreEnterLeaveNonLinear()
372 WindowPtr child = FirstPointerChild(A); in CoreEnterLeaveNonLinear() local
374 if (child) in CoreEnterLeaveNonLinear()
409 subwindow is set to the child containing the previous P(W) in CoreEnterLeaveNonLinear()
413 or vice-versa depending on the previous P(W). */ in CoreEnterLeaveNonLinear()
416 WindowPtr child = FirstPointerChild(B); in CoreEnterLeaveNonLinear() local
418 if (child) in CoreEnterLeaveNonLinear()
445 is set to the child containing the new P(W), the detail field in CoreEnterLeaveToAncestor()
453 WindowPtr child = FirstPointerChild(A); in CoreEnterLeaveToAncestor() local
455 if (child) in CoreEnterLeaveToAncestor()
476 field should be set to the child containing the old P(W) <<< WRONG */ in CoreEnterLeaveToAncestor()
500 is set to the child containing the new P(W) <<< THIS IS WRONG */ in CoreEnterLeaveToDescendant()
519 subwindow is set to the child containing the previous P(W) in CoreEnterLeaveToDescendant()
523 or vice-versa depending on the previous P(W). */ in CoreEnterLeaveToDescendant()
526 WindowPtr child = FirstPointerChild(B); in CoreEnterLeaveToDescendant() local
528 if (child) in CoreEnterLeaveToDescendant()
614 int nval = v->numAxes - first; in FixDeviceValuator()
616 ev->type = DeviceValuator; in FixDeviceValuator()
617 ev->deviceid = dev->id; in FixDeviceValuator()
618 ev->num_valuators = nval < 3 ? nval : 3; in FixDeviceValuator()
619 ev->first_valuator = first; in FixDeviceValuator()
620 switch (ev->num_valuators) { in FixDeviceValuator()
622 ev->valuator2 = v->axisVal[first + 2]; in FixDeviceValuator()
624 ev->valuator1 = v->axisVal[first + 1]; in FixDeviceValuator()
626 ev->valuator0 = v->axisVal[first]; in FixDeviceValuator()
629 first += ev->num_valuators; in FixDeviceValuator()
636 ev->type = DeviceStateNotify; in FixDeviceStateNotify()
637 ev->deviceid = dev->id; in FixDeviceStateNotify()
638 ev->time = currentTime.milliseconds; in FixDeviceStateNotify()
639 ev->classes_reported = 0; in FixDeviceStateNotify()
640 ev->num_keys = 0; in FixDeviceStateNotify()
641 ev->num_buttons = 0; in FixDeviceStateNotify()
642 ev->num_valuators = 0; in FixDeviceStateNotify()
645 ev->classes_reported |= (1 << ButtonClass); in FixDeviceStateNotify()
646 ev->num_buttons = b->numButtons; in FixDeviceStateNotify()
647 memcpy((char *) ev->buttons, (char *) b->down, 4); in FixDeviceStateNotify()
650 ev->classes_reported |= (1 << KeyClass); in FixDeviceStateNotify()
651 ev->num_keys = k->xkbInfo->desc->max_key_code - in FixDeviceStateNotify()
652 k->xkbInfo->desc->min_key_code; in FixDeviceStateNotify()
653 memmove((char *) &ev->keys[0], (char *) k->down, 4); in FixDeviceStateNotify()
656 int nval = v->numAxes - first; in FixDeviceStateNotify()
658 ev->classes_reported |= (1 << ValuatorClass); in FixDeviceStateNotify()
659 ev->classes_reported |= valuator_get_mode(dev, 0) << ModeBitsShift; in FixDeviceStateNotify()
660 ev->num_valuators = nval < 3 ? nval : 3; in FixDeviceStateNotify()
661 switch (ev->num_valuators) { in FixDeviceStateNotify()
663 ev->valuator2 = v->axisVal[first + 2]; in FixDeviceStateNotify()
665 ev->valuator1 = v->axisVal[first + 1]; in FixDeviceStateNotify()
667 ev->valuator0 = v->axisVal[first]; in FixDeviceStateNotify()
688 !(wOtherInputMasks(win)->inputEvents[dev->id] & DeviceStateNotifyMask)) in DeliverStateNotifyEvent()
691 if ((b = dev->button) != NULL) { in DeliverStateNotifyEvent()
692 nbuttons = b->numButtons; in DeliverStateNotifyEvent()
696 if ((k = dev->key) != NULL) { in DeliverStateNotifyEvent()
697 nkeys = k->xkbInfo->desc->max_key_code - k->xkbInfo->desc->min_key_code; in DeliverStateNotifyEvent()
704 if ((v = dev->valuator) != NULL) { in DeliverStateNotifyEvent()
705 nval = v->numAxes; in DeliverStateNotifyEvent()
713 evcount += ((nval - 7) / 3); in DeliverStateNotifyEvent()
723 nval -= 3; in DeliverStateNotifyEvent()
725 (ev - 1)->deviceid |= MORE_EVENTS; in DeliverStateNotifyEvent()
727 bev->type = DeviceButtonStateNotify; in DeliverStateNotifyEvent()
728 bev->deviceid = dev->id; in DeliverStateNotifyEvent()
729 memcpy((char *) &bev->buttons[4], (char *) &b->down[4], in DeliverStateNotifyEvent()
730 DOWN_LENGTH - 4); in DeliverStateNotifyEvent()
733 (ev - 1)->deviceid |= MORE_EVENTS; in DeliverStateNotifyEvent()
736 nval -= 3; in DeliverStateNotifyEvent()
743 nval -= 3; in DeliverStateNotifyEvent()
745 (ev - 1)->deviceid |= MORE_EVENTS; in DeliverStateNotifyEvent()
747 kev->type = DeviceKeyStateNotify; in DeliverStateNotifyEvent()
748 kev->deviceid = dev->id; in DeliverStateNotifyEvent()
749 memmove((char *) &kev->keys[0], (char *) &k->down[4], 28); in DeliverStateNotifyEvent()
752 (ev - 1)->deviceid |= MORE_EVENTS; in DeliverStateNotifyEvent()
755 nval -= 3; in DeliverStateNotifyEvent()
762 nval -= 3; in DeliverStateNotifyEvent()
764 (ev - 1)->deviceid |= MORE_EVENTS; in DeliverStateNotifyEvent()
767 nval -= 3; in DeliverStateNotifyEvent()
788 btlen = (mouse->button) ? bits_to_bytes(mouse->button->numButtons) : 0; in DeviceFocusEvent()
793 xi2event->type = GenericEvent; in DeviceFocusEvent()
794 xi2event->extension = IReqCode; in DeviceFocusEvent()
795 xi2event->evtype = type; in DeviceFocusEvent()
796 xi2event->length = bytes_to_int32(len - sizeof(xEvent)); in DeviceFocusEvent()
797 xi2event->buttons_len = btlen; in DeviceFocusEvent()
798 xi2event->detail = detail; in DeviceFocusEvent()
799 xi2event->time = currentTime.milliseconds; in DeviceFocusEvent()
800 xi2event->deviceid = dev->id; in DeviceFocusEvent()
801 xi2event->sourceid = dev->id; /* a device doesn't change focus by itself */ in DeviceFocusEvent()
802 xi2event->mode = mode; in DeviceFocusEvent()
803 xi2event->root_x = double_to_fp1616(mouse->spriteInfo->sprite->hot.x); in DeviceFocusEvent()
804 xi2event->root_y = double_to_fp1616(mouse->spriteInfo->sprite->hot.y); in DeviceFocusEvent()
806 for (i = 0; mouse && mouse->button && i < mouse->button->numButtons; i++) in DeviceFocusEvent()
807 if (BitIsOn(mouse->button->down, i)) in DeviceFocusEvent()
808 SetBit(&xi2event[1], mouse->button->map[i]); in DeviceFocusEvent()
810 if (dev->key) { in DeviceFocusEvent()
811 xi2event->mods.base_mods = dev->key->xkbInfo->state.base_mods; in DeviceFocusEvent()
812 xi2event->mods.latched_mods = dev->key->xkbInfo->state.latched_mods; in DeviceFocusEvent()
813 xi2event->mods.locked_mods = dev->key->xkbInfo->state.locked_mods; in DeviceFocusEvent()
814 xi2event->mods.effective_mods = dev->key->xkbInfo->state.mods; in DeviceFocusEvent()
816 xi2event->group.base_group = dev->key->xkbInfo->state.base_group; in DeviceFocusEvent()
817 xi2event->group.latched_group = dev->key->xkbInfo->state.latched_group; in DeviceFocusEvent()
818 xi2event->group.locked_group = dev->key->xkbInfo->state.locked_group; in DeviceFocusEvent()
819 xi2event->group.effective_group = dev->key->xkbInfo->state.group; in DeviceFocusEvent()
822 FixUpEventFromWindow(dev->spriteInfo->sprite, (xEvent *) xi2event, pWin, in DeviceFocusEvent()
832 .deviceid = dev->id, in DeviceFocusEvent()
836 .window = pWin->drawable.id, in DeviceFocusEvent()
848 * Send focus out events to all windows between 'child' and 'ancestor'.
853 WindowPtr child, WindowPtr ancestor, int mode, int detail) in DeviceFocusOutEvents() argument
857 if (ancestor == child) in DeviceFocusOutEvents()
859 for (win = child->parent; win != ancestor; win = win->parent) in DeviceFocusOutEvents()
864 * Send enter notifies to all windows between 'ancestor' and 'child' (excluding
870 WindowPtr ancestor, WindowPtr child, int mode, int detail) in DeviceFocusInEvents() argument
872 WindowPtr parent = child->parent; in DeviceFocusInEvents() local
874 if (ancestor == parent || !parent) in DeviceFocusInEvents()
876 DeviceFocusInEvents(dev, ancestor, parent, mode, detail); in DeviceFocusInEvents()
877 DeviceFocusEvent(dev, XI_FocusIn, mode, detail, parent); in DeviceFocusInEvents()
881 * Send FocusIn events to all windows between 'ancestor' and 'child' (excluding
887 WindowPtr ancestor, WindowPtr child, int mode, int detail) in CoreFocusInEvents() argument
889 WindowPtr parent = child->parent; in CoreFocusInEvents() local
891 if (ancestor == parent) in CoreFocusInEvents()
893 CoreFocusInEvents(dev, ancestor, parent, mode, detail); in CoreFocusInEvents()
913 if (!HasFocus(parent) && !FirstFocusChild(parent)) in CoreFocusInEvents()
914 CoreFocusEvent(dev, FocusIn, mode, detail, parent); in CoreFocusInEvents()
919 WindowPtr child, WindowPtr ancestor, int mode, int detail) in CoreFocusOutEvents() argument
923 if (ancestor == child) in CoreFocusOutEvents()
926 for (win = child->parent; win != ancestor; win = win->parent) { in CoreFocusOutEvents()
943 or vice-versa depending on the new P(W). */ in CoreFocusOutEvents()
945 /* If one window has a focus or a child with a focuspointer, skip some in CoreFocusOutEvents()
983 stopAt = (inclusive) ? pwin_parent->parent : pwin_parent; in CoreFocusOutNotifyPointerEvents()
985 for (; P && P != stopAt; P = P->parent) in CoreFocusOutNotifyPointerEvents()
1000 CoreFocusInRecurse(dev, win->parent, stopAt, mode, inclusive); in CoreFocusInRecurse()
1009 * @param exclude If the pointer window is a child of 'exclude', no events are
1060 WindowPtr child = FirstFocusChild(A); in CoreFocusNonLinear() local
1062 if (child) { in CoreFocusNonLinear()
1063 /* NotifyPointer P-A unless P is child or below */ in CoreFocusNonLinear()
1064 CoreFocusOutNotifyPointerEvents(dev, A, child, mode, FALSE); in CoreFocusNonLinear()
1068 /* NotifyPointer P-A */ in CoreFocusNonLinear()
1104 or vice-versa depending on the previous F(W). */ in CoreFocusNonLinear()
1107 WindowPtr child = FirstFocusChild(B); in CoreFocusNonLinear() local
1109 if (child) { in CoreFocusNonLinear()
1111 /* NotifyPointer B-P unless P is child or below. */ in CoreFocusNonLinear()
1112 CoreFocusInNotifyPointerEvents(dev, B, child, mode, FALSE); in CoreFocusNonLinear()
1116 /* NotifyPointer B-P unless P is child or below. */ in CoreFocusNonLinear()
1147 WindowPtr child = FirstFocusChild(A); in CoreFocusToAncestor() local
1149 if (child) { in CoreFocusToAncestor()
1150 /* NotifyPointer P-A unless P is child or below */ in CoreFocusToAncestor()
1151 CoreFocusOutNotifyPointerEvents(dev, A, child, mode, FALSE); in CoreFocusToAncestor()
1174 /* NotifyPointer B-P unless P is A or below. */ in CoreFocusToAncestor()
1198 /* NotifyPointer P-A unless P is B or below */ in CoreFocusToDescendant()
1220 or vice-versa depending on the previous F(W). */ in CoreFocusToDescendant()
1223 WindowPtr child = FirstFocusChild(B); in CoreFocusToDescendant() local
1225 if (child) { in CoreFocusToDescendant()
1227 /* NotifyPointer B-P unless P is child or below. */ in CoreFocusToDescendant()
1228 CoreFocusInNotifyPointerEvents(dev, B, child, mode, FALSE); in CoreFocusToDescendant()
1241 if (i != exclude->id && PointerWindows[i] == win) in HasOtherPointer()
1267 root = screenInfo.screens[i]->root; in CoreFocusPointerRootNoneSwitch()
1273 if (dev->focus && dev->focus->win == PointerRootWin && in CoreFocusPointerRootNoneSwitch()
1311 WindowPtr child = FirstFocusChild(A); in CoreFocusToPointerRootOrNone() local
1313 if (child) { in CoreFocusToPointerRootOrNone()
1314 /* NotifyPointer P-A unless P is B or below */ in CoreFocusToPointerRootOrNone()
1319 /* NotifyPointer P-A */ in CoreFocusToPointerRootOrNone()
1329 root = screenInfo.screens[i]->root; in CoreFocusToPointerRootOrNone()
1358 root = screenInfo.screens[i]->root; in CoreFocusFromPointerRootOrNone()
1363 if (dev->focus && dev->focus->win == PointerRootWin && in CoreFocusFromPointerRootOrNone()
1377 while (root->parent) in CoreFocusFromPointerRootOrNone()
1378 root = root->parent; in CoreFocusFromPointerRootOrNone()
1386 WindowPtr child = FirstFocusChild(B); in CoreFocusFromPointerRootOrNone() local
1388 if (child) { in CoreFocusFromPointerRootOrNone()
1390 /* NotifyPointer B-P unless P is child or below. */ in CoreFocusFromPointerRootOrNone()
1391 CoreFocusInNotifyPointerEvents(dev, B, child, mode, FALSE); in CoreFocusFromPointerRootOrNone()
1395 /* NotifyPointer B-P unless P is child or below. */ in CoreFocusFromPointerRootOrNone()
1434 SpritePtr sprite = dev->spriteInfo->sprite; in DeviceFocusEvents()
1451 sprite->win); in DeviceFocusEvents()
1452 DeviceFocusOutEvents(dev, sprite->win, in DeviceFocusEvents()
1459 screenInfo.screens[i]->root); in DeviceFocusEvents()
1462 if (IsParent(from, sprite->win)) { in DeviceFocusEvents()
1464 sprite->win); in DeviceFocusEvents()
1465 DeviceFocusOutEvents(dev, sprite->win, from, mode, in DeviceFocusEvents()
1476 screenInfo.screens[i]->root); in DeviceFocusEvents()
1478 DeviceFocusInEvents(dev, GetCurrentRootWindow(dev), sprite->win, in DeviceFocusEvents()
1480 DeviceFocusEvent(dev, XI_FocusIn, mode, NotifyPointer, sprite->win); in DeviceFocusEvents()
1487 sprite->win); in DeviceFocusEvents()
1488 DeviceFocusOutEvents(dev, sprite->win, in DeviceFocusEvents()
1494 screenInfo.screens[i]->root); in DeviceFocusEvents()
1495 if (to->parent != NullWindow) in DeviceFocusEvents()
1499 if (IsParent(to, sprite->win)) in DeviceFocusEvents()
1500 DeviceFocusInEvents(dev, to, sprite->win, mode, NotifyPointer); in DeviceFocusEvents()
1507 if ((IsParent(to, sprite->win)) && in DeviceFocusEvents()
1508 (sprite->win != from) && in DeviceFocusEvents()
1509 (!IsParent(from, sprite->win)) && in DeviceFocusEvents()
1510 (!IsParent(sprite->win, from))) in DeviceFocusEvents()
1511 DeviceFocusInEvents(dev, to, sprite->win, mode, in DeviceFocusEvents()
1515 if ((IsParent(from, sprite->win)) && in DeviceFocusEvents()
1516 (sprite->win != from) && in DeviceFocusEvents()
1517 (!IsParent(to, sprite->win)) && in DeviceFocusEvents()
1518 (!IsParent(sprite->win, to))) { in DeviceFocusEvents()
1520 sprite->win); in DeviceFocusEvents()
1521 DeviceFocusOutEvents(dev, sprite->win, from, mode, in DeviceFocusEvents()
1529 /* neither from or to is child of other */ in DeviceFocusEvents()
1533 if (IsParent(from, sprite->win)) in DeviceFocusEvents()
1534 DeviceFocusOutEvents(dev, sprite->win, from, mode, in DeviceFocusEvents()
1537 if (from->parent != NullWindow) in DeviceFocusEvents()
1540 if (to->parent != NullWindow) in DeviceFocusEvents()
1544 if (IsParent(to, sprite->win)) in DeviceFocusEvents()
1545 DeviceFocusInEvents(dev, to, sprite->win, mode, in DeviceFocusEvents()