Lines Matching defs:grab
80 GrabPtr grab = devGrab->grab;
83 ErrorF("Active grab 0x%lx (%s) on device '%s' (%d):\n",
84 (unsigned long) grab->resource,
85 (grab->grabtype == XI2) ? "xi2" :
86 ((grab->grabtype == CORE) ? "core" : "xi1"), dev->name, dev->id);
88 client = clients[CLIENT_ID(grab->resource)];
110 CLIENT_ID(grab->resource));
115 ErrorF(" grab ID 0x%lx from paired device\n",
118 ErrorF(" at %ld (from %s grab)%s (device %s, state %d)\n",
124 if (grab->grabtype == CORE) {
126 (unsigned long) grab->eventMask);
128 else if (grab->grabtype == XI) {
130 devGrab->implicitGrab ? (unsigned long) grab->deviceMask :
131 (unsigned long) grab->eventMask);
133 else if (grab->grabtype == XI2) {
134 for (i = 0; i < xi2mask_num_masks(grab->xi2mask); i++) {
140 mask = xi2mask_get_one_mask(grab->xi2mask, i);
149 for (j = 0; j < xi2mask_mask_size(grab->xi2mask); j++)
156 ErrorF(" passive grab type %d, detail 0x%x, "
157 "activating key %d\n", grab->type, grab->detail.exact,
162 grab->ownerEvents ? "true" : "false",
163 grab->keyboardMode, grab->pointerMode,
164 grab->confineTo ? (unsigned long) grab->confineTo->drawable.id : 0,
165 grab->cursor ? (unsigned long) grab->cursor->id : 0);
178 if (!dev->deviceGrab.grab)
181 client = clients[CLIENT_ID(dev->deviceGrab.grab->resource)];
194 GrabPtr grab = calloc(1, sizeof(GrabRec));
196 if (grab) {
197 grab->xi2mask = xi2mask_new();
198 if (!grab->xi2mask) {
199 free(grab);
200 grab = NULL;
202 else if (src && !CopyGrab(grab, src)) {
203 free(grab->xi2mask);
204 free(grab);
205 grab = NULL;
209 return grab;
219 GrabPtr grab;
221 grab = AllocGrab(NULL);
222 if (!grab)
224 grab->resource = FakeClientID(client);
225 grab->device = device;
226 grab->window = window;
228 grab->eventMask = mask->core; /* same for XI */
230 grab->eventMask = 0;
231 grab->deviceMask = 0;
232 grab->ownerEvents = param->ownerEvents;
233 grab->keyboardMode = param->this_device_mode;
234 grab->pointerMode = param->other_devices_mode;
235 grab->modifiersDetail.exact = param->modifiers;
236 grab->modifiersDetail.pMask = NULL;
237 grab->modifierDevice = modDevice;
238 grab->type = type;
239 grab->grabtype = grabtype;
240 grab->detail.exact = keybut;
241 grab->detail.pMask = NULL;
242 grab->confineTo = confineTo;
243 grab->cursor = RefCursor(cursor);
244 grab->next = NULL;
247 xi2mask_merge(grab->xi2mask, mask->xi2mask);
248 return grab;
324 /* it is OK if the grab isn't found */
421 * Compares two grabs and returns TRUE if the first grab matches the second
422 * grab.
425 * - the devices set for the grab are equal (this is optional).
521 * Prepend the new grab to the list of passive grabs on the window.
522 * Any previously existing grab that matches the new grab will be removed.
523 * Adding a new grab that would override another client's grab will result in
531 GrabPtr grab;
535 for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) {
536 if (GrabMatchesSecond(pGrab, grab, (pGrab->grabtype == CORE))) {
537 if (CLIENT_BITS(pGrab->resource) != CLIENT_BITS(grab->resource)) {
552 for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next) {
553 if (GrabsAreIdentical(pGrab, grab)) {
554 DeletePassiveGrabFromList(grab);
578 GrabPtr grab;
593 for (grab = wPassiveGrabs(pMinuendGrab->window); grab; grab = grab->next)
615 for (grab = wPassiveGrabs(pMinuendGrab->window);
616 grab && ok; grab = grab->next) {
617 if ((CLIENT_BITS(grab->resource) != CLIENT_BITS(pMinuendGrab->resource))
618 || !GrabMatchesSecond(grab, pMinuendGrab, (grab->grabtype == CORE)))
620 if (GrabSupersedesSecond(pMinuendGrab, grab)) {
621 deletes[ndels++] = grab;
623 else if ((grab->detail.exact == any_key)
624 && (grab->modifiersDetail.exact != any_modifier)) {
625 UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
627 else if ((grab->modifiersDetail.exact == any_modifier)
628 && (grab->detail.exact != any_key)) {
629 UPDATE(grab->modifiersDetail.pMask,
637 UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
640 param.ownerEvents = grab->ownerEvents;
641 param.this_device_mode = grab->keyboardMode;
642 param.other_devices_mode = grab->pointerMode;
645 pNewGrab = CreateGrab(CLIENT_ID(grab->resource), grab->device,
646 grab->modifierDevice, grab->window,
647 grab->grabtype,
648 (GrabMask *) &grab->eventMask,
649 ¶m, (int) grab->type,
651 grab->confineTo, grab->cursor);
655 DeleteDetailFromMask(grab->modifiersDetail.pMask,
670 UPDATE(grab->modifiersDetail.pMask,
674 UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
688 grab = adds[i];
689 grab->next = grab->window->optional->passiveGrabs;
690 grab->window->optional->passiveGrabs = grab;
707 GrabIsPointerGrab(GrabPtr grab)
709 return (grab->type == ButtonPress ||
710 grab->type == DeviceButtonPress || grab->type == XI_ButtonPress);
714 GrabIsKeyboardGrab(GrabPtr grab)
716 return (grab->type == KeyPress ||
717 grab->type == DeviceKeyPress || grab->type == XI_KeyPress);
721 GrabIsGestureGrab(GrabPtr grab)
723 return (grab->type == XI_GesturePinchBegin ||
724 grab->type == XI_GestureSwipeBegin);