diff options
author | marha <marha@users.sourceforge.net> | 2013-06-04 09:07:26 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-06-04 09:48:59 +0200 |
commit | fd2b28971a2afbf54b6cb641aa6a2d5e940a1450 (patch) | |
tree | 1b103a8b2114125ffa8d79827d931aba3744a0d2 /xorg-server/dix/events.c | |
parent | 62a1ce0583cf41c173f4edb91511430b552e04da (diff) | |
download | vcxsrv-fd2b28971a2afbf54b6cb641aa6a2d5e940a1450.tar.gz vcxsrv-fd2b28971a2afbf54b6cb641aa6a2d5e940a1450.tar.bz2 vcxsrv-fd2b28971a2afbf54b6cb641aa6a2d5e940a1450.zip |
xwininfo fontconfig libX11 libXau libXdmcp libXext mesa libXinerama libxcb libxcb/xcb-proto libfontenc pixman xkbcomp mkfontscale xkeyboard-config git update 4 Jun 2013
xserver commit c21344add2fc589df83b29be5831c36a372201bd
libxcb commit 9ae84ad187e2ba440c40f44b8eb21c82c2fdbf12
libxcb/xcb-proto commit bdfedfa57a13ff805580cfacafc70f9cc55df363
xkeyboard-config commit dad9ade4e83d1ef5a517fcc4cc9ad3a79b47acce
libX11 commit 8496122eb00ce6cd5d2308ee54f64b68c378e455
libXdmcp commit 0b443c1b769b9c9a3b45b4252afe07e18b709ff4
libXext commit d8366afbb0d2e4fbb1e419b1187f490522270bea
libfontenc commit 3acba630d8b57084f7e92c15732408711ed5137a
libXinerama commit 6e1d1dc328ba8162bba2f4694e7f3c706a1491ff
libXau commit 899790011304c4029e15abf410e49ce7cec17e0a
xkbcomp commit ed582f4fccd4e23abcfba8b3b03649fea6414f44
pixman commit 2acfac5f8e097ee2ae225d986f981b55d65dd152
mkfontscale commit 19e2cb7c6a3ec2c5b1bc0d24866fa685eef0ee13
xwininfo commit ba0d1b0da21d2dbdd81098ed5778f3792b472e13
fontconfig commit cd9b1033a68816a7acfbba1718ba0aa5888f6ec7
mesa commit 7bafd88c153e395274b632e7eae4bc9fc3aec1d2
Diffstat (limited to 'xorg-server/dix/events.c')
-rwxr-xr-x[-rw-r--r--] | xorg-server/dix/events.c | 89 |
1 files changed, 45 insertions, 44 deletions
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c index 6c249b01c..0296b7865 100644..100755 --- a/xorg-server/dix/events.c +++ b/xorg-server/dix/events.c @@ -934,8 +934,7 @@ ChangeToCursor(DeviceIntPtr pDev, CursorPtr cursor) (*pScreen->DisplayCursor) (pDev, pScreen, cursor); FreeCursor(pSprite->current, (Cursor) 0); - pSprite->current = cursor; - pSprite->current->refcnt++; + pSprite->current = RefCursor(cursor); } } @@ -1430,21 +1429,23 @@ UpdateTouchesForGrab(DeviceIntPtr mouse) for (i = 0; i < mouse->touch->num_touches; i++) { TouchPointInfoPtr ti = mouse->touch->touches + i; + TouchListener *listener = &ti->listeners[0]; GrabPtr grab = mouse->deviceGrab.grab; if (ti->active && - CLIENT_BITS(ti->listeners[0].listener) == grab->resource) { - ti->listeners[0].listener = grab->resource; - ti->listeners[0].level = grab->grabtype; - ti->listeners[0].state = LISTENER_IS_OWNER; - ti->listeners[0].window = grab->window; + CLIENT_BITS(listener->listener) == grab->resource) { + listener->listener = grab->resource; + listener->level = grab->grabtype; + listener->state = LISTENER_IS_OWNER; + listener->window = grab->window; if (grab->grabtype == CORE || grab->grabtype == XI || !xi2mask_isset(grab->xi2mask, mouse, XI_TouchBegin)) - ti->listeners[0].type = LISTENER_POINTER_GRAB; + listener->type = LISTENER_POINTER_GRAB; else - ti->listeners[0].type = LISTENER_GRAB; - ti->listeners[0].grab = grab; + listener->type = LISTENER_GRAB; + FreeGrab(listener->grab); + listener->grab = AllocGrab(grab); } } } @@ -1469,6 +1470,7 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, TimeStamp time, Bool autoGrab) { GrabInfoPtr grabinfo = &mouse->deviceGrab; + GrabPtr oldgrab = grabinfo->grab; WindowPtr oldWin = (grabinfo->grab) ? grabinfo->grab->window : mouse->spriteInfo->sprite->win; Bool isPassive = autoGrab & ~ImplicitGrabMask; @@ -1491,16 +1493,15 @@ ActivatePointerGrab(DeviceIntPtr mouse, GrabPtr grab, grabinfo->grabTime = syncEvents.time; else grabinfo->grabTime = time; - if (grab->cursor) - grab->cursor->refcnt++; - CopyGrab(grabinfo->activeGrab, grab); - grabinfo->grab = grabinfo->activeGrab; + grabinfo->grab = AllocGrab(grab); grabinfo->fromPassiveGrab = isPassive; grabinfo->implicitGrab = autoGrab & ImplicitGrabMask; PostNewCursor(mouse); UpdateTouchesForGrab(mouse); CheckGrabForSyncs(mouse, (Bool) grab->pointerMode, (Bool) grab->keyboardMode); + if (oldgrab) + FreeGrab(oldgrab); } /** @@ -1550,13 +1551,13 @@ DeactivatePointerGrab(DeviceIntPtr mouse) if (grab->confineTo) ConfineCursorToWindow(mouse, GetCurrentRootWindow(mouse), FALSE, FALSE); PostNewCursor(mouse); - if (grab->cursor) - FreeCursor(grab->cursor, (Cursor) 0); if (!wasImplicit && grab->grabtype == XI2) ReattachToOldMaster(mouse); ComputeFreezes(); + + FreeGrab(grab); } /** @@ -1569,6 +1570,7 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, Bool passive) { GrabInfoPtr grabinfo = &keybd->deviceGrab; + GrabPtr oldgrab = grabinfo->grab; WindowPtr oldWin; /* slave devices need to float for the duration of the grab. */ @@ -1594,12 +1596,13 @@ ActivateKeyboardGrab(DeviceIntPtr keybd, GrabPtr grab, TimeStamp time, grabinfo->grabTime = syncEvents.time; else grabinfo->grabTime = time; - CopyGrab(grabinfo->activeGrab, grab); - grabinfo->grab = grabinfo->activeGrab; + grabinfo->grab = AllocGrab(grab); grabinfo->fromPassiveGrab = passive; grabinfo->implicitGrab = passive & ImplicitGrabMask; CheckGrabForSyncs(keybd, (Bool) grab->keyboardMode, (Bool) grab->pointerMode); + if (oldgrab) + FreeGrab(oldgrab); } /** @@ -1641,6 +1644,8 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) ReattachToOldMaster(keybd); ComputeFreezes(); + + FreeGrab(grab); } void @@ -1745,6 +1750,16 @@ AllowSome(ClientPtr client, TimeStamp time, DeviceIntPtr thisDev, int newState) } break; } + + /* We've unfrozen the grab. If the grab was a touch grab, we're now the + * owner and expected to accept/reject it. Reject == ReplayPointer which + * we've handled in ComputeFreezes() (during DeactivateGrab) above, + * anything else is accept. + */ + if (newState != NOT_GRABBED /* Replay */ && + IsTouchEvent((InternalEvent*)grabinfo->sync.event)) { + TouchAcceptAndEnd(thisDev, grabinfo->sync.event->touchid); + } } /** @@ -1977,7 +1992,7 @@ ActivateImplicitGrab(DeviceIntPtr dev, ClientPtr client, WindowPtr win, else return FALSE; - tempGrab = AllocGrab(); + tempGrab = AllocGrab(NULL); if (!tempGrab) return FALSE; tempGrab->next = NULL; @@ -3198,11 +3213,10 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin) pSprite->pEnqueueScreen = screenInfo.screens[0]; pSprite->pDequeueScreen = pSprite->pEnqueueScreen; } - if (pCursor) - pCursor->refcnt++; + pCursor = RefCursor(pCursor); if (pSprite->current) FreeCursor(pSprite->current, None); - pSprite->current = pCursor; + pSprite->current = RefCursor(pCursor); if (pScreen) { (*pScreen->RealizeCursor) (pDev, pScreen, pSprite->current); @@ -3281,9 +3295,7 @@ UpdateSpriteForScreen(DeviceIntPtr pDev, ScreenPtr pScreen) pSprite->hotLimits.x2 = pScreen->width; pSprite->hotLimits.y2 = pScreen->height; pSprite->win = win; - pCursor = wCursor(win); - if (pCursor) - pCursor->refcnt++; + pCursor = RefCursor(wCursor(win)); if (pSprite->current) FreeCursor(pSprite->current, 0); pSprite->current = pCursor; @@ -3885,7 +3897,7 @@ CheckPassiveGrabsOnWindow(WindowPtr pWin, if (!grab) return NULL; - tempGrab = AllocGrab(); + tempGrab = AllocGrab(NULL); /* Fill out the grab details, but leave the type for later before * comparing */ @@ -4845,7 +4857,6 @@ ProcGrabPointer(ClientPtr client) GrabPtr grab; GrabMask mask; WindowPtr confineTo; - CursorPtr oldCursor; BYTE status; REQUEST(xGrabPointerReq); @@ -4868,15 +4879,10 @@ ProcGrabPointer(ClientPtr client) return rc; } - oldCursor = NullCursor; grab = device->deviceGrab.grab; - if (grab) { - if (grab->confineTo && !confineTo) - ConfineCursorToWindow(device, GetCurrentRootWindow(device), FALSE, - FALSE); - oldCursor = grab->cursor; - } + if (grab && grab->confineTo && !confineTo) + ConfineCursorToWindow(device, GetCurrentRootWindow(device), FALSE, FALSE); mask.core = stuff->eventMask; @@ -4886,9 +4892,6 @@ ProcGrabPointer(ClientPtr client) if (rc != Success) return rc; - if (oldCursor && status == GrabSuccess) - FreeCursor(oldCursor, (Cursor) 0); - memset(&rep, 0, sizeof(xGrabPointerReply)); rep.type = X_Reply; rep.status = status; @@ -4943,9 +4946,7 @@ ProcChangeActivePointerGrab(ClientPtr client) (CompareTimeStamps(time, device->deviceGrab.grabTime) == EARLIER)) return Success; oldCursor = grab->cursor; - grab->cursor = newCursor; - if (newCursor) - newCursor->refcnt++; + grab->cursor = RefCursor(newCursor); PostNewCursor(device); if (oldCursor) FreeCursor(oldCursor, (Cursor) 0); @@ -5075,7 +5076,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, else { GrabPtr tempGrab; - tempGrab = AllocGrab(); + tempGrab = AllocGrab(NULL); tempGrab->next = NULL; tempGrab->window = pWin; @@ -5090,7 +5091,7 @@ GrabDevice(ClientPtr client, DeviceIntPtr dev, else xi2mask_merge(tempGrab->xi2mask, mask->xi2mask); tempGrab->device = dev; - tempGrab->cursor = cursor; + tempGrab->cursor = RefCursor(cursor); tempGrab->confineTo = confineTo; tempGrab->grabtype = grabtype; (*grabInfo->ActivateGrab) (dev, tempGrab, time, FALSE); @@ -5431,7 +5432,7 @@ ProcUngrabKey(ClientPtr client) client->errorValue = stuff->modifiers; return BadValue; } - tempGrab = AllocGrab(); + tempGrab = AllocGrab(NULL); if (!tempGrab) return BadAlloc; tempGrab->resource = client->clientAsMask; @@ -5623,7 +5624,7 @@ ProcUngrabButton(ClientPtr client) ptr = PickPointer(client); - tempGrab = AllocGrab(); + tempGrab = AllocGrab(NULL); if (!tempGrab) return BadAlloc; tempGrab->resource = client->clientAsMask; |