Lines Matching refs:grab

188  * Used to indicate a implicit passive grab created by a ButtonPress event.
789 pWin = pDev->deviceGrab.grab ? pDev->deviceGrab.grab->confineTo : NullWindow;
961 GrabPtr grab = pDev->deviceGrab.grab;
967 if (grab)
969 if (grab->cursor)
971 ChangeToCursor(pDev, grab->cursor);
974 if (IsParent(grab->window, pSprite->win))
977 win = grab->window;
1268 GrabPtr grab;
1309 if ((grab = dev->deviceGrab.grab) && grab->confineTo)
1311 if (grab->confineTo->drawable.pScreen !=
1315 ConfineCursorToWindow(dev, grab->confineTo, TRUE, TRUE);
1330 GrabPtr grab;
1340 if ((grab = pDev->deviceGrab.grab) && grab->confineTo)
1342 if (grab->confineTo->drawable.pScreen
1345 ConfineCursorToWindow(pDev, grab->confineTo, TRUE, TRUE);
1358 GrabPtr grab = thisDev->deviceGrab.grab;
1368 CLIENT_BITS(grab->resource)))
1376 dev->deviceGrab.sync.other = grab;
1381 CLIENT_BITS(grab->resource)))
1391 * the duration of the grab, the device is detached, ungrabbing re-attaches it
1395 * while the device has a grab.
1426 * Activate a pointer grab on the given device. A pointer grab will cause all
1428 * No other device will send core events to the grab client while the grab is
1430 * Can cause the cursor to change if a grab cursor is set.
1432 * Note that parameter autoGrab may be (True & ImplicitGrabMask) if the grab
1433 * is an implicit grab caused by a ButtonPress event.
1435 * @param mouse The device to grab.
1436 * @param grab The grab structure, needs to be setup.
1437 * @param autoGrab True if the grab was caused by a button down event and not
1441 ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab,
1445 WindowPtr oldWin = (grabinfo->grab) ?
1446 grabinfo->grab->window
1450 /* slave devices need to float for the duration of the grab. */
1451 if (grab->grabtype == GRABTYPE_XI2 &&
1455 if (grab->confineTo)
1457 if (grab->confineTo->drawable.pScreen
1461 ConfineCursorToWindow(mouse, grab->confineTo, FALSE, TRUE);
1463 DoEnterLeaveEvents(mouse, mouse->id, oldWin, grab->window, NotifyGrab);
1469 if (grab->cursor)
1470 grab->cursor->refcnt++;
1471 grabinfo->activeGrab = *grab;
1472 grabinfo->grab = &grabinfo->activeGrab;
1476 CheckGrabForSyncs(mouse,(Bool)grab->pointerMode, (Bool)grab->keyboardMode);
1480 * Delete grab on given device, update the sprite.
1487 GrabPtr grab = mouse->deviceGrab.grab;
1493 mouse->deviceGrab.grab = NullGrab;
1499 if (dev->deviceGrab.sync.other == grab)
1502 DoEnterLeaveEvents(mouse, mouse->id, grab->window,
1504 if (grab->confineTo)
1507 if (grab->cursor)
1508 FreeCursor(grab->cursor, (Cursor)0);
1510 if (!wasImplicit && grab->grabtype == GRABTYPE_XI2)
1517 * Activate a keyboard grab on the given device.
1522 ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive)
1527 /* slave devices need to float for the duration of the grab. */
1528 if (grab->grabtype == GRABTYPE_XI2 &&
1533 if (grabinfo->grab)
1534 oldWin = grabinfo->grab->window;
1543 DoFocusEvents(keybd, oldWin, grab->window, NotifyGrab);
1548 grabinfo->activeGrab = *grab;
1549 grabinfo->grab = &grabinfo->activeGrab;
1552 CheckGrabForSyncs(keybd, (Bool)grab->keyboardMode, (Bool)grab->pointerMode);
1556 * Delete keyboard grab for the given device.
1561 GrabPtr grab = keybd->deviceGrab.grab;
1572 keybd->deviceGrab.grab = NullGrab;
1578 if (dev->deviceGrab.sync.other == grab)
1581 DoFocusEvents(keybd, grab->window, focusWin, NotifyUngrab);
1583 if (!wasImplicit && grab->grabtype == GRABTYPE_XI2)
1601 thisGrabbed = grabinfo->grab && SameClient(grabinfo->grab, client);
1612 if (devgrabinfo->grab && SameClient(devgrabinfo->grab, client))
1618 if (grabinfo->sync.other == devgrabinfo->grab)
1653 if (devgrabinfo->grab
1654 && SameClient(devgrabinfo->grab, client))
1669 if (devgrabinfo->grab
1670 && SameClient(devgrabinfo->grab, client))
1685 syncEvents.replayWin = grabinfo->grab->window;
1698 if (devgrabinfo->grab
1699 && SameClient(devgrabinfo->grab, client))
1779 if (dev->deviceGrab.grab && SameClient(dev->deviceGrab.grab, client))
1803 * - no other client has a grab on the device that caused the event.
1812 * @param grab Possible grab on the device that caused the event.
1814 * @return 1 if event was delivered, 0 if not or -1 if grab was not set by the
1819 int count, Mask mask, Mask filter, GrabPtr grab)
1845 if (grab && !SameClient(grab, client))
1848 ErrorF(" not delivered due to grab\n");
1936 * actually needs to be delivered. May activate a grab if the event is a
1950 * @param grab Possible grab on the device that caused the event.
1956 *pEvents, int count, Mask filter, GrabPtr grab)
1962 Mask deliveryMask = 0; /* If a grab occurs due to a button press, then
1963 this mask is the mask of the grab. */
1982 filter, grab)) )
2029 mask, filter, grab)) )
2042 * Note that since core events are delivered first, an implicit grab may
2043 * be activated on a core grab, stopping the XI events.
2048 && (!grab))
2094 grab, client, deliveryMask);
2110 GrabPtr grab,
2117 if (grab && !SameClient(grab, client)) return -1;
2354 * @param grab Possible grab on a device.
2362 DeliverDeviceEvents(WindowPtr pWin, InternalEvent *event, GrabPtr grab,
2390 filter, grab);
2408 filter, grab);
2426 filter, grab);
2598 * Ungrab a currently FocusIn grabbed device and grab the device on the
2610 if (dev->deviceGrab.grab)
2613 dev->deviceGrab.grab->type != XI_Enter ||
2614 dev->deviceGrab.grab->window == win ||
2615 IsParent(dev->deviceGrab.grab->window, win))
2639 * Ungrab a currently Enter grabbed device and grab the device for the given
2650 if (dev->deviceGrab.grab)
2653 dev->deviceGrab.grab->type != XI_Enter ||
2654 dev->deviceGrab.grab->window == win ||
2655 IsParent(dev->deviceGrab.grab->window, win))
2816 GrabPtr grab;
2845 if ((grab = pDev->deviceGrab.grab) && grab->confineTo) {
2846 if (grab->confineTo->drawable.pScreen
2849 ConfineCursorToWindow(pDev, grab->confineTo, TRUE, TRUE);
3341 * passive grab set on the window to be activated.
3342 * If activate is true and a passive grab is found, it will be activated,
3345 * @param pWin The window that may be subject to a passive grab.
3349 * @param activate If a grab is found, activate it and deliver the event.
3361 GrabPtr grab = wPassiveGrabs(pWin);
3369 if (!grab)
3371 /* Fill out the grab details, but leave the type for later before
3379 for (; grab; grab = grab->next)
3384 gdev= grab->modifierDevice;
3385 if (grab->grabtype == GRABTYPE_CORE)
3391 } else if (grab->grabtype == GRABTYPE_XI2)
3395 * reattached after the grab, the modifier device may not be the
3397 if (!IsMaster(grab->device) && device->u.master)
3404 tempGrab.modifierDevice = grab->modifierDevice;
3410 if (GrabMatchesSecond(&tempGrab, grab, FALSE))
3418 (GrabMatchesSecond(&tempGrab, grab, FALSE)))
3422 /* Check for a core grab (ignore the device when comparing) */
3427 (GrabMatchesSecond(&tempGrab, grab, TRUE)))
3431 if (match && (!grab->confineTo ||
3432 (grab->confineTo->realized &&
3433 BorderSizeNotEmpty(device, grab->confineTo))))
3442 /* In some cases a passive core grab may exist, but the client
3443 * already has a core grab on some other device. In this case we
3444 * must not get the grab, otherwise we may never ungrab the
3448 if (grab->grabtype == GRABTYPE_CORE)
3453 /* A passive grab may have been created for a different device
3455 Update the grab's device and modifier device to reflect the
3462 grab->device = device;
3463 grab->modifierDevice = GetPairedDevice(device);
3468 GrabPtr othergrab = other->deviceGrab.grab;
3470 SameClient(grab, rClient(othergrab)) &&
3471 ((IsPointerDevice(grab->device) &&
3473 (IsKeyboardDevice(grab->device) &&
3485 return grab;
3522 (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
3526 FixUpEventFromWindow(pSprite, xE, grab->window, None, TRUE);
3528 TryClientEvents(rClient(grab), device, xE, count,
3530 GetEventFilter(device, xE), grab);
3543 return grab;
3554 * a passive grab to be activated.
3564 * causes a passive grab to activate or all the windows are
3567 * If a grab is activated, the event has been sent to the client already!
3575 * @return TRUE if a grab has been activated or false otherwise.
3594 if (device->deviceGrab.grab)
3727 * grab. If not, TryClientEvents() is used.
3729 * @param deactivateGrab True if the device's grab should be deactivated.
3735 GrabPtr grab;
3746 grab = grabinfo->grab;
3748 if (grab->ownerEvents)
3767 deliveries = DeliverDeviceEvents(pSprite->win, event, grab,
3771 deliveries = DeliverDeviceEvents(pSprite->win, event, grab, focus,
3774 deliveries = DeliverDeviceEvents(focus, event, grab, focus,
3787 mask = grab->eventMask;
3791 if (sendCore && grab->grabtype == GRABTYPE_CORE)
3798 FixUpEventFromWindow(pSprite, &core, grab->window, None, TRUE);
3800 grab->window, &core, 1) ||
3801 XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
3802 grab->window, &core, 1))
3804 else if (!IsInterferingGrab(rClient(grab), thisDev, &core))
3806 deliveries = TryClientEvents(rClient(grab), thisDev,
3809 grab);
3821 mask = grab->xi2mask[XIAllDevices][evtype/8] |
3822 grab->xi2mask[XIAllMasterDevices][evtype/8] |
3823 grab->xi2mask[thisDev->id][evtype/8];
3825 FixUpEventFromWindow(pSprite, xi2, grab->window, None, TRUE);
3827 deliveries = TryClientEvents(rClient(grab), thisDev, xi2, 1, mask,
3828 GetEventFilter(thisDev, xi2), grab);
3842 mask = grab->deviceMask;
3844 mask = grab->eventMask;
3846 FixUpEventFromWindow(pSprite, xi, grab->window, None, TRUE);
3849 grab->window, xi, count) ||
3850 XaceHook(XACE_RECEIVE_ACCESS, rClient(grab),
3851 grab->window, xi, count))
3856 TryClientEvents(rClient(grab), thisDev,
3860 grab);
3868 thisDev->valuator->motionHintWindow = grab->window;
3880 (CLIENT_BITS(grab->resource) ==
3881 CLIENT_BITS(dev->deviceGrab.grab->resource)))
3884 dev->deviceGrab.sync.other = grab;
4165 GrabPtr grab = mouse->deviceGrab.grab;
4173 if (grab)
4175 mask = (pWin == grab->window) ? grab->eventMask : 0;
4176 if (grab->ownerEvents)
4177 mask |= EventMaskForClient(pWin, rClient(grab));
4209 if (grab)
4210 TryClientEvents(rClient(grab), mouse, &event, 1, mask,
4211 GetEventFilter(mouse, &event), grab);
4221 ClientPtr client = grab ? rClient(grab) : wClient(pWin);
4228 if (grab)
4229 TryClientEvents(rClient(grab), keybd, (xEvent *)&ke, 1,
4230 mask, KeymapStateMask, grab);
4247 GrabPtr grab = mouse->deviceGrab.grab;
4296 if (grab)
4299 mask = grab->xi2mask[XIAllDevices][type/8] |
4300 grab->xi2mask[XIAllMasterDevices][type/8] |
4301 grab->xi2mask[mouse->id][type/8];
4302 TryClientEvents(rClient(grab), mouse, (xEvent*)event, 1, mask,
4303 filter, grab);
4416 mode = (dev->deviceGrab.grab) ? NotifyWhileGrabbed : NotifyNormal;
4507 * Sets an active grab on the client's ClientPointer and returns success
4515 GrabPtr grab;
4544 grab = device->deviceGrab.grab;
4546 if (grab)
4548 if (grab->confineTo && !confineTo)
4551 oldCursor = grab->cursor;
4577 * Changes properties of the grab hold by the client. If the client does not
4578 * hold an active grab on the device, nothing happens.
4584 GrabPtr grab;
4609 grab = device->deviceGrab.grab;
4611 if (!grab)
4613 if (!SameClient(grab, client))
4619 oldCursor = grab->cursor;
4620 grab->cursor = newCursor;
4626 grab->eventMask = stuff->eventMask;
4633 * Deletes a pointer grab on a device the client has grabbed.
4639 GrabPtr grab;
4645 grab = device->deviceGrab.grab;
4650 (grab) && SameClient(grab, client))
4656 * Sets a grab on the given device.
4665 * @param client Client that owns the grab.
4666 * @param dev The device to grab.
4680 GrabPtr grab;
4739 grab = grabInfo->grab;
4740 if (grab && grab->grabtype != grabtype)
4742 if (grab && !SameClient(grab, client))
4820 * Deletes a possible grab on the client's keyboard.
4826 GrabPtr grab;
4833 grab = device->deviceGrab.grab;
4838 (grab) && SameClient(grab, client) && grab->grabtype == GRABTYPE_CORE)
5103 * Deletes a passive grab for the given key. Works on the
5153 * Creates a grab for the client's keyboard and adds it to the list of passive
5161 GrabPtr grab;
5194 grab = CreateGrab(client->index, keybd, keybd, pWin, GRABTYPE_CORE, &mask,
5196 if (!grab)
5198 return AddPassiveGrabToList(client, grab);
5205 * Creates a grab for the client's ClientPointer and adds it as a passive grab
5214 GrabPtr grab;
5293 grab = CreateGrab(client->index, ptr, modifierDevice, pWin,
5296 if (!grab)
5298 return AddPassiveGrabToList(client, grab);
5304 * Deletes a passive grab on the client's ClientPointer from the list.
5346 * Deactivate any grab that may be on the window, remove the focus.
5365 GrabPtr grab;
5370 grab = mouse->deviceGrab.grab;
5371 if (grab &&
5372 ((grab->window == pWin) || (grab->confineTo == pWin)))
5376 /* Deactivating a keyboard grab should cause focus events. */
5377 grab = keybd->deviceGrab.grab;
5378 if (grab && (grab->window == pWin))
5384 grab = mouse->deviceGrab.grab;
5385 if (grab && ((grab->window == pWin) || (grab->confineTo == pWin)))
5403 /* If a grab is in progress, then alter the mode of focus events. */
5405 if (keybd->deviceGrab.grab)
5469 * there is a grab on the window, the cursor will be re-confined into the
5475 GrabPtr grab;
5487 grab = pDev->deviceGrab.grab;
5488 if (grab && (confineTo = grab->confineTo))
5727 * 1) A device the given client has a core grab on.
5736 /* First, check if the client currently has a grab on a device. Even
5740 GrabPtr grab = it->deviceGrab.grab;
5741 if (grab && grab->grabtype == GRABTYPE_CORE && SameClient(grab, client))
5784 * devices it does not have a grab on. Legacy applications behave bad
5810 if (dev->deviceGrab.grab && SameClient(dev->deviceGrab.grab, client))
5817 if (it->deviceGrab.grab && SameClient(it->deviceGrab.grab, client)