summaryrefslogtreecommitdiff
path: root/xserver/Xi
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu.herrb@laas.fr>2013-02-24 15:45:52 +0100
committerMatthieu Herrb <matthieu.herrb@laas.fr>2013-02-24 15:49:36 +0100
commit3c7d5a1f6c188eed12275ff6884a6d8fd1669ffd (patch)
tree5b72ec229f01b3cccf52935a3c9eb7998addced6 /xserver/Xi
parentbf92adb413c678cf9583c52c3ba70eb470aa5164 (diff)
Merge server-1.13.3rc1 branch from X.Org.
up to e604b19fc54fee839bbe2d66930b36108ff03950
Diffstat (limited to 'xserver/Xi')
-rw-r--r--xserver/Xi/Makefile.in2
-rw-r--r--xserver/Xi/exevents.c93
-rw-r--r--xserver/Xi/xichangehierarchy.c9
3 files changed, 48 insertions, 56 deletions
diff --git a/xserver/Xi/Makefile.in b/xserver/Xi/Makefile.in
index d5e782e02..ae608dc30 100644
--- a/xserver/Xi/Makefile.in
+++ b/xserver/Xi/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.12.5 from Makefile.am.
+# Makefile.in generated by automake 1.12.6 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2012 Free Software Foundation, Inc.
diff --git a/xserver/Xi/exevents.c b/xserver/Xi/exevents.c
index 106da3a1b..20038a635 100644
--- a/xserver/Xi/exevents.c
+++ b/xserver/Xi/exevents.c
@@ -1197,7 +1197,6 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
TouchOwnershipEvent *ev)
{
Bool was_owner = (resource == ti->listeners[0].listener);
- void *grab;
int i;
/* Send a TouchEnd event to the resource being removed, but only if they
@@ -1212,11 +1211,7 @@ TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
/* Remove the resource from the listener list, updating
* ti->num_listeners, as well as ti->num_grabs if it was a grab. */
- if (TouchRemoveListener(ti, resource)) {
- if (dixLookupResourceByType(&grab, resource, RT_PASSIVEGRAB,
- serverClient, DixGetAttrAccess) == Success)
- ti->num_grabs--;
- }
+ TouchRemoveListener(ti, resource);
/* If the current owner was removed and there are further listeners, deliver
* the TouchOwnership or TouchBegin event to the new owner. */
@@ -1310,34 +1305,19 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
if (listener->type == LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) {
- rc = dixLookupResourceByType((pointer *) grab, listener->listener,
- RT_PASSIVEGRAB,
- serverClient, DixSendAccess);
- if (rc != Success) {
- /* the grab doesn't exist but we have a grabbing listener - this
- * is an implicit/active grab */
- rc = dixLookupClient(client, listener->listener, serverClient,
- DixSendAccess);
- if (rc != Success)
- return FALSE;
-
- *grab = dev->deviceGrab.grab;
- if (!*grab)
- return FALSE;
- }
+
+ *grab = listener->grab;
+
+ BUG_RETURN_VAL(!*grab, FALSE);
*client = rClient(*grab);
*win = (*grab)->window;
*mask = (*grab)->xi2mask;
}
else {
- if (listener->level == CORE)
- rc = dixLookupWindow(win, listener->listener,
- serverClient, DixSendAccess);
- else
- rc = dixLookupResourceByType((pointer *) win, listener->listener,
- RT_INPUTCLIENT,
- serverClient, DixSendAccess);
+ rc = dixLookupResourceByType((pointer *) win, listener->listener,
+ listener->resource_type,
+ serverClient, DixSendAccess);
if (rc != Success)
return FALSE;
@@ -1477,6 +1457,8 @@ DeliverTouchEmulatedEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
*/
l = &ti->listeners[ti->num_listeners - 1];
l->listener = devgrab->resource;
+ l->grab = devgrab;
+ //l->resource_type = RT_NONE;
if (devgrab->grabtype != XI2 || devgrab->type != XI_TouchBegin)
l->type = LISTENER_POINTER_GRAB;
@@ -1576,32 +1558,41 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
else
ti = TouchFindByClientID(dev, touchid);
- /* Under the following circumstances we create a new touch record for an
- * existing touch:
- *
- * - The touch may be pointer emulated
- * - An explicit grab is active on the device
- * - The grab is a pointer grab
- *
- * This allows for an explicit grab to receive pointer events for an already
- * active touch.
- */
- if (!ti && type != ET_TouchBegin && emulate_pointer &&
- dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
+ /* Active pointer grab */
+ if (emulate_pointer && dev->deviceGrab.grab && !dev->deviceGrab.fromPassiveGrab &&
(dev->deviceGrab.grab->grabtype == CORE ||
dev->deviceGrab.grab->grabtype == XI ||
- !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin))) {
- ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
- emulate_pointer);
- if (!ti) {
- DebugF("[Xi] %s: Failed to create new dix record for explicitly "
- "grabbed touchpoint %d\n",
- dev->name, type, touchid);
- return;
- }
+ !xi2mask_isset(dev->deviceGrab.grab->xi2mask, dev, XI_TouchBegin)))
+ {
+ /* Active pointer grab on touch point and we get a TouchEnd - claim this
+ * touchpoint accepted, otherwise clients waiting for ownership will
+ * wait on this touchpoint until this client ungrabs, or the cows come
+ * home, whichever is earlier */
+ if (ti && type == ET_TouchEnd)
+ TouchListenerAcceptReject(dev, ti, 0, XIAcceptTouch);
+ else if (!ti && type != ET_TouchBegin) {
+ /* Under the following circumstances we create a new touch record for an
+ * existing touch:
+ *
+ * - The touch may be pointer emulated
+ * - An explicit grab is active on the device
+ * - The grab is a pointer grab
+ *
+ * This allows for an explicit grab to receive pointer events for an already
+ * active touch.
+ */
+ ti = TouchBeginTouch(dev, ev->device_event.sourceid, touchid,
+ emulate_pointer);
+ if (!ti) {
+ DebugF("[Xi] %s: Failed to create new dix record for explicitly "
+ "grabbed touchpoint %d\n",
+ dev->name, touchid);
+ return;
+ }
- TouchBuildSprite(dev, ti, ev);
- TouchSetupListeners(dev, ti, ev);
+ TouchBuildSprite(dev, ti, ev);
+ TouchSetupListeners(dev, ti, ev);
+ }
}
if (!ti) {
diff --git a/xserver/Xi/xichangehierarchy.c b/xserver/Xi/xichangehierarchy.c
index 89f16d8be..4dc3d76e9 100644
--- a/xserver/Xi/xichangehierarchy.c
+++ b/xserver/Xi/xichangehierarchy.c
@@ -304,15 +304,16 @@ remove_master(ClientPtr client, xXIRemoveMasterInfo * r, int flags[MAXDEVICES])
flags[keybd->id] |= XIDeviceDisabled;
flags[ptr->id] |= XIDeviceDisabled;
- RemoveDevice(XTestptr, FALSE);
- RemoveDevice(XTestkeybd, FALSE);
- RemoveDevice(keybd, FALSE);
- RemoveDevice(ptr, FALSE);
flags[XTestptr->id] |= XISlaveRemoved;
flags[XTestkeybd->id] |= XISlaveRemoved;
flags[keybd->id] |= XIMasterRemoved;
flags[ptr->id] |= XIMasterRemoved;
+ RemoveDevice(XTestptr, FALSE);
+ RemoveDevice(XTestkeybd, FALSE);
+ RemoveDevice(keybd, FALSE);
+ RemoveDevice(ptr, FALSE);
+
unwind:
return rc;
}