Lines Matching defs:grab
85 GrabPtr grab;
87 grab = calloc(1, sizeof(GrabRec));
88 if (!grab)
90 grab->resource = FakeClientID(client);
91 grab->device = device;
92 grab->window = window;
93 grab->eventMask = mask->core; /* same for XI */
94 grab->deviceMask = 0;
95 grab->ownerEvents = param->ownerEvents;
96 grab->keyboardMode = param->this_device_mode;
97 grab->pointerMode = param->other_devices_mode;
98 grab->modifiersDetail.exact = param->modifiers;
99 grab->modifiersDetail.pMask = NULL;
100 grab->modifierDevice = modDevice;
101 grab->type = type;
102 grab->grabtype = grabtype;
103 grab->detail.exact = keybut;
104 grab->detail.pMask = NULL;
105 grab->confineTo = confineTo;
106 grab->cursor = cursor;
107 grab->next = NULL;
110 memcpy(grab->xi2mask, mask->xi2mask, sizeof(mask->xi2mask));
113 return grab;
135 /* it is OK if the grab isn't found */
246 * Compares two grabs and returns TRUE if the first grab matches the second
247 * grab.
250 * - the devices set for the grab are equal (this is optional).
354 * Prepend the new grab to the list of passive grabs on the window.
355 * Any previously existing grab that matches the new grab will be removed.
356 * Adding a new grab that would override another client's grab will result in
364 GrabPtr grab;
368 for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next)
370 if (GrabMatchesSecond(pGrab, grab, FALSE))
372 if (CLIENT_BITS(pGrab->resource) != CLIENT_BITS(grab->resource))
387 for (grab = wPassiveGrabs(pGrab->window); grab; grab = grab->next)
389 if (GrabsAreIdentical(pGrab, grab))
391 DeletePassiveGrabFromList(grab);
416 GrabPtr grab;
431 for (grab = wPassiveGrabs(pMinuendGrab->window); grab; grab = grab->next)
454 for (grab = wPassiveGrabs(pMinuendGrab->window);
455 grab && ok;
456 grab = grab->next)
458 if ((CLIENT_BITS(grab->resource) != CLIENT_BITS(pMinuendGrab->resource)) ||
459 !GrabMatchesSecond(grab, pMinuendGrab,
460 (grab->grabtype == GRABTYPE_CORE)))
462 if (GrabSupersedesSecond(pMinuendGrab, grab))
464 deletes[ndels++] = grab;
466 else if ((grab->detail.exact == any_key)
467 && (grab->modifiersDetail.exact != any_modifier))
469 UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
471 else if ((grab->modifiersDetail.exact == any_modifier)
472 && (grab->detail.exact != any_key))
474 UPDATE(grab->modifiersDetail.pMask,
483 UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
486 param.ownerEvents = grab->ownerEvents;
487 param.this_device_mode = grab->keyboardMode;
488 param.other_devices_mode = grab->pointerMode;
491 pNewGrab = CreateGrab(CLIENT_ID(grab->resource), grab->device,
492 grab->modifierDevice, grab->window,
493 grab->grabtype,
494 (GrabMask*)&grab->eventMask,
495 ¶m, (int)grab->type,
497 grab->confineTo, grab->cursor);
501 DeleteDetailFromMask(grab->modifiersDetail.pMask,
518 UPDATE(grab->modifiersDetail.pMask,
523 UPDATE(grab->detail.pMask, pMinuendGrab->detail.exact);
540 grab = adds[i];
541 grab->next = grab->window->optional->passiveGrabs;
542 grab->window->optional->passiveGrabs = grab;