[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xorg-server: Changes to 'ubuntu'



 ChangeLog                                                                     |  232 ++++++++++
 Xi/exevents.c                                                                 |  190 ++++----
 Xi/xiallowev.c                                                                |   81 +--
 configure.ac                                                                  |    2 
 debian/changelog                                                              |   24 +
 debian/patches/501_touch_accept_end.patch                                     |   95 ++++
 debian/patches/502_indirect_touch_window_set.patch                            |   40 +
 debian/patches/600-Revert-dix-deduplicate-callers-of-DeliverDeviceEvent.patch |   59 --
 debian/patches/601-Store-window-pointer-in-touch-listener-record.patch        |  110 ----
 debian/patches/602-Factor-out-TouchEnd-generation-and-delivery.patch          |  184 -------
 debian/patches/603-Export-TouchEventRejected-as-TouchRejected.patch           |  115 ----
 debian/patches/604-Move-AllowTouch-to-dix-touch.c-and-rename-to-TouchAc.patch |  155 ------
 debian/patches/605-Check-for-proper-window-ID-when-processing-touch-all.patch |   87 ---
 debian/patches/606-Implement-early-touch-reject.patch                         |   37 -
 debian/patches/607-Implement-touch-early-accept.patch                         |  108 ----
 debian/patches/608-dix-fix-an-out-of-memory-crash.patch                       |   28 -
 debian/patches/609-Xi-handle-new-XIAllowEvents-request-in-inputproto-2..patch |  102 ----
 debian/patches/610-Fix-scrolling.patch                                        |  121 -----
 debian/patches/611-Fix-touch-punt-crash.patch                                 |   31 -
 debian/patches/612-Fix-vcp-touches-corruption.patch                           |   45 -
 debian/patches/613-Keep-vcp-touch-class.patch                                 |   42 -
 debian/patches/series                                                         |   18 
 dix/events.c                                                                  |   39 -
 dix/getevents.c                                                               |   21 
 dix/inpututils.c                                                              |    3 
 dix/touch.c                                                                   |   73 ++-
 include/exevents.h                                                            |    7 
 include/input.h                                                               |    7 
 include/inputstr.h                                                            |    1 
 test/.gitignore                                                               |    1 
 test/xi2/.gitignore                                                           |    1 
 31 files changed, 650 insertions(+), 1409 deletions(-)

New commits:
commit 251f795b62eb8498662498fecbd6f99567e4d6e2
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 7 15:36:34 2012 -0800

    releasing version 2:1.11.4-0ubuntu5

diff --git a/debian/changelog b/debian/changelog
index f1aa5e9..1b7b6a9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-xorg-server (2:1.11.4-0ubuntu5) UNRELEASED; urgency=low
+xorg-server (2:1.11.4-0ubuntu5) precise; urgency=low
 
   * Update to 1.12 input stack 
   * Drop input patches that have been merged upstream:
@@ -20,7 +20,7 @@ xorg-server (2:1.11.4-0ubuntu5) UNRELEASED; urgency=low
     - Add temporary patch 501_touch_accept_end.patch
     - Add temporary patch 502_indirect_touch_window_set.patch
 
- -- Chase Douglas <chase.douglas@ubuntu.com>  Wed, 07 Mar 2012 15:34:09 -0800
+ -- Chase Douglas <chase.douglas@ubuntu.com>  Wed, 07 Mar 2012 15:36:20 -0800
 
 xorg-server (2:1.11.4-0ubuntu4) precise; urgency=low
 

commit f0d61a62e95a3cef3240cae7e52fdd05ba76e6a9
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Wed Mar 7 15:33:16 2012 -0800

    Fix indirect touch grab handling (LP: #929408)
    
    * Fix indirect touch grab handling (LP: #929408)
      - Add temporary patch 501_touch_accept_end.patch
      - Add temporary patch 502_indirect_touch_window_set.patch

diff --git a/debian/changelog b/debian/changelog
index 08d333c..f1aa5e9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -16,8 +16,11 @@ xorg-server (2:1.11.4-0ubuntu5) UNRELEASED; urgency=low
     - 611-Fix-touch-punt-crash.patch
     - 612-Fix-vcp-touches-corruption.patch
     - 613-Keep-vcp-touch-class.patch
+  * Fix indirect touch grab handling (LP: #929408)
+    - Add temporary patch 501_touch_accept_end.patch
+    - Add temporary patch 502_indirect_touch_window_set.patch
 
- -- Chase Douglas <chase.douglas@ubuntu.com>  Mon, 05 Mar 2012 15:16:28 -0800
+ -- Chase Douglas <chase.douglas@ubuntu.com>  Wed, 07 Mar 2012 15:34:09 -0800
 
 xorg-server (2:1.11.4-0ubuntu4) precise; urgency=low
 
diff --git a/debian/patches/501_touch_accept_end.patch b/debian/patches/501_touch_accept_end.patch
new file mode 100644
index 0000000..03f7524
--- /dev/null
+++ b/debian/patches/501_touch_accept_end.patch
@@ -0,0 +1,95 @@
+From 40cd6abb66787c79465cda03c17297a06d1cd848 Mon Sep 17 00:00:00 2001
+From: Chase Douglas <chase.douglas@canonical.com>
+Date: Fri, 2 Mar 2012 14:40:07 -0800
+Subject: [PATCH 1/2] Xi: Fix TouchEnd to TouchUpdate change for one accepted
+ grab
+
+If there is only one listener of a touch, the listener is a grab, and is
+accepted before the touch has ended, the current code will not end the
+touch record when the touch does end.
+
+This change adds a listener state for when a touch is accepted but has
+not yet ended. We now keep the touch record alive in this state, but end
+it when the touch ends.
+
+Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+---
+ Xi/exevents.c   |   25 ++++++++++++++++---------
+ include/input.h |    3 ++-
+ 2 files changed, 18 insertions(+), 10 deletions(-)
+
+diff --git a/Xi/exevents.c b/Xi/exevents.c
+index f390f67..d71e604 100644
+--- a/Xi/exevents.c
++++ b/Xi/exevents.c
+@@ -1252,6 +1252,8 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
+         /* Owner accepted after receiving end */
+         if (ti->listeners[0].state == LISTENER_HAS_END)
+             TouchEndTouch(dev, ti);
++        else
++            ti->listeners[0].state = LISTENER_HAS_ACCEPTED;
+     } else { /* this is the very first ownership event for a grab */
+         DeliverTouchEvents(dev, ti, (InternalEvent*)ev, ev->resource);
+     }
+@@ -1781,7 +1783,11 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev
+     {
+         if (has_ownershipmask)
+             TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
+-        state = LISTENER_IS_OWNER;
++
++        if (!has_ownershipmask || listener->type == LISTENER_REGULAR)
++            state = LISTENER_HAS_ACCEPTED;
++        else
++            state = LISTENER_IS_OWNER;
+     }
+     listener->state = state;
+ 
+@@ -1812,22 +1818,23 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
+         listener->state = LISTENER_HAS_END;
+     } else if (TouchResourceIsOwner(ti, listener->listener))
+     {
++        Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
++
+         /* FIXME: what about early acceptance */
+-        if (!(ev->device_event.flags & TOUCH_ACCEPT))
+-        {
+-            if (listener->state != LISTENER_HAS_END)
+-                rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
+-            listener->state = LISTENER_HAS_END;
+-        }
++        if (normal_end && listener->state != LISTENER_HAS_END)
++            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
++
+         if ((ti->num_listeners > 1 ||
+-             (listener->type == LISTENER_GRAB &&
+-              xi2mask_isset(xi2mask, dev, XI_TouchOwnership))) &&
++             listener->state != LISTENER_HAS_ACCEPTED) &&
+             (ev->device_event.flags & (TOUCH_ACCEPT|TOUCH_REJECT)) == 0)
+         {
+             ev->any.type = ET_TouchUpdate;
+             ev->device_event.flags |= TOUCH_PENDING_END;
+             ti->pending_finish = TRUE;
+         }
++
++        if (normal_end)
++            listener->state = LISTENER_HAS_END;
+     }
+ 
+ out:
+diff --git a/include/input.h b/include/input.h
+index b7825a7..1e9e0fd 100644
+--- a/include/input.h
++++ b/include/input.h
+@@ -585,7 +585,8 @@ enum TouchListenerState{
+     LISTENER_AWAITING_OWNER,       /**< Waiting for a TouchOwnership event */
+     LISTENER_EARLY_ACCEPT,         /**< Waiting for ownership, has already
+                                         accepted */
+-    LISTENER_IS_OWNER,             /**< Is the current owner */
++    LISTENER_IS_OWNER,             /**< Is the current owner, hasn't accepted */
++    LISTENER_HAS_ACCEPTED,         /**< Is the current owner, has accepted */
+     LISTENER_HAS_END,              /**< Has already received the end event */
+ };
+ 
+-- 
+1.7.9
+
diff --git a/debian/patches/502_indirect_touch_window_set.patch b/debian/patches/502_indirect_touch_window_set.patch
new file mode 100644
index 0000000..5eafe81
--- /dev/null
+++ b/debian/patches/502_indirect_touch_window_set.patch
@@ -0,0 +1,40 @@
+From d128edad09452246e18b38cef151cad226f1c5f5 Mon Sep 17 00:00:00 2001
+From: Chase Douglas <chase.douglas@canonical.com>
+Date: Wed, 7 Mar 2012 15:20:12 -0800
+Subject: [PATCH 2/2] Use a new sprite trace for indirect touches when all
+ touches have physically ended
+
+All touches of an indirect device, such as a trackpad, are sent to the
+same window set. When there are no active touches, a new window set is
+created; otherwise, the window set of an existing touch is copied.
+
+The current code checks for any logically active touches. This includes
+touches that have physically ended but are still logically active due to
+unhandled touch grabs. Instead, we want a new window set whenever there
+are no physically active touches.
+
+This change skips over logically active but pending end touches, which
+are touches that have physically ended.
+
+Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
+---
+ dix/touch.c |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/dix/touch.c b/dix/touch.c
+index d04801c..0aa24f2 100644
+--- a/dix/touch.c
++++ b/dix/touch.c
+@@ -524,7 +524,8 @@ TouchBuildDependentSpriteTrace(DeviceIntPtr dev, SpritePtr sprite)
+     /* All touches should have the same sprite trace, so find and reuse an
+      * existing touch's sprite if possible, else use the device's sprite. */
+     for (i = 0; i < t->num_touches; i++)
+-        if (t->touches[i].sprite.spriteTraceGood > 0)
++        if (!t->touches[i].pending_finish &&
++            t->touches[i].sprite.spriteTraceGood > 0)
+             break;
+     if (i < t->num_touches)
+         srcsprite = &t->touches[i].sprite;
+-- 
+1.7.9
+
diff --git a/debian/patches/series b/debian/patches/series
index f78b1c0..fde4653 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -32,3 +32,5 @@
 
 # Temporary, until it's reviewed & accepted upstream
 500_pointer_barrier_thresholds.diff
+501_touch_accept_end.patch
+502_indirect_touch_window_set.patch

commit 3ab63fb459a94992c7996236739d71dcd26a04a8
Author: Chase Douglas <chase.douglas@canonical.com>
Date:   Mon Mar 5 15:17:46 2012 -0800

    Drop input patches that have been merged upstream:
    
    * Drop input patches that have been merged upstream:
      - 600-Revert-dix-deduplicate-callers-of-DeliverDeviceEvent.patch
      - 601-Store-window-pointer-in-touch-listener-record.patch
      - 602-Factor-out-TouchEnd-generation-and-delivery.patch
      - 603-Export-TouchEventRejected-as-TouchRejected.patch
      - 604-Move-AllowTouch-to-dix-touch.c-and-rename-to-TouchAc.patch
      - 605-Check-for-proper-window-ID-when-processing-touch-all.patch
      - 606-Implement-early-touch-reject.patch
      - 607-Implement-touch-early-accept.patch
      - 608-dix-fix-an-out-of-memory-crash.patch
      - 609-Xi-handle-new-XIAllowEvents-request-in-inputproto-2..patch
      - 610-Fix-scrolling.patch
      - 611-Fix-touch-punt-crash.patch
      - 612-Fix-vcp-touches-corruption.patch
      - 613-Keep-vcp-touch-class.patch

diff --git a/debian/changelog b/debian/changelog
index 5ce4b7e..08d333c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,23 @@
 xorg-server (2:1.11.4-0ubuntu5) UNRELEASED; urgency=low
 
   * Update to 1.12 input stack 
+  * Drop input patches that have been merged upstream:
+    - 600-Revert-dix-deduplicate-callers-of-DeliverDeviceEvent.patch
+    - 601-Store-window-pointer-in-touch-listener-record.patch
+    - 602-Factor-out-TouchEnd-generation-and-delivery.patch
+    - 603-Export-TouchEventRejected-as-TouchRejected.patch
+    - 604-Move-AllowTouch-to-dix-touch.c-and-rename-to-TouchAc.patch
+    - 605-Check-for-proper-window-ID-when-processing-touch-all.patch
+    - 606-Implement-early-touch-reject.patch
+    - 607-Implement-touch-early-accept.patch
+    - 608-dix-fix-an-out-of-memory-crash.patch
+    - 609-Xi-handle-new-XIAllowEvents-request-in-inputproto-2..patch
+    - 610-Fix-scrolling.patch
+    - 611-Fix-touch-punt-crash.patch
+    - 612-Fix-vcp-touches-corruption.patch
+    - 613-Keep-vcp-touch-class.patch
 
- -- Chase Douglas <chase.douglas@ubuntu.com>  Mon, 05 Mar 2012 15:11:25 -0800
+ -- Chase Douglas <chase.douglas@ubuntu.com>  Mon, 05 Mar 2012 15:16:28 -0800
 
 xorg-server (2:1.11.4-0ubuntu4) precise; urgency=low
 
diff --git a/debian/patches/600-Revert-dix-deduplicate-callers-of-DeliverDeviceEvent.patch b/debian/patches/600-Revert-dix-deduplicate-callers-of-DeliverDeviceEvent.patch
deleted file mode 100644
index 2630963..0000000
--- a/debian/patches/600-Revert-dix-deduplicate-callers-of-DeliverDeviceEvent.patch
+++ /dev/null
@@ -1,59 +0,0 @@
-From f92ba92adfce0e1975feb54ab0e1165b7c2a7bea Mon Sep 17 00:00:00 2001
-From: Peter Hutterer <peter.hutterer@who-t.net>
-Date: Sat, 4 Feb 2012 19:27:21 +1000
-Subject: [PATCH] Revert "dix: deduplicate callers of DeliverDeviceEvents in
- DeliverGrabbedEvents"
-
-This call was supposed to have no functional changes but in some cases
-DeliverDeviceEvents() was called with a uninitialised win variable.
-Revert, safer than trying to sort this out otherwise.
-
-This reverts commit 6eff14a789341d366b3013c5aa020e959c954651.
-
-Reported-by: Mathieu Taillefumier <mathieu.taillefumier@free.fr>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-Reviewed-by: Keith Packard <keithp@keithp.com>
----
- dix/events.c |   18 ++++++++----------
- 1 files changed, 8 insertions(+), 10 deletions(-)
-
-diff --git a/dix/events.c b/dix/events.c
-index 04d7fb5..3c7d5d0 100644
---- a/dix/events.c
-+++ b/dix/events.c
-@@ -4266,7 +4266,6 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
-     if (grab->ownerEvents)
-     {
- 	WindowPtr focus;
--	WindowPtr win;
- 
-         /* Hack: Some pointer device have a focus class. So we need to check
-          * for the type of event, to see if we really want to deliver it to
-@@ -4283,16 +4282,15 @@ DeliverGrabbedEvent(InternalEvent *event, DeviceIntPtr thisDev,
- 	else
- 	    focus = PointerRootWin;
- 	if (focus == PointerRootWin)
--	{
--	    win = pSprite->win;
--	    focus = NullWindow;
--	} else if (focus && (focus == pSprite->win ||
--		    IsParent(focus, pSprite->win)))
--	    win = pSprite->win;
-+	    deliveries = DeliverDeviceEvents(pSprite->win, event, grab,
-+                                             NullWindow, thisDev);
-+	else if (focus && (focus == pSprite->win ||
-+                    IsParent(focus, pSprite->win)))
-+	    deliveries = DeliverDeviceEvents(pSprite->win, event, grab, focus,
-+					     thisDev);
- 	else if (focus)
--	    win = focus;
--
--	deliveries = DeliverDeviceEvents(win, event, grab, focus, thisDev);
-+	    deliveries = DeliverDeviceEvents(focus, event, grab, focus,
-+					     thisDev);
-     }
-     if (!deliveries)
-     {
--- 
-1.7.8.3
-
diff --git a/debian/patches/601-Store-window-pointer-in-touch-listener-record.patch b/debian/patches/601-Store-window-pointer-in-touch-listener-record.patch
deleted file mode 100644
index 58ee8db..0000000
--- a/debian/patches/601-Store-window-pointer-in-touch-listener-record.patch
+++ /dev/null
@@ -1,110 +0,0 @@
-From ab60cadc2afb9d8882144e30fde11c3ef0f999cd Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Fri, 3 Feb 2012 16:19:05 -0800
-Subject: [PATCH] Store window pointer in touch listener record
-
-Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
----
- dix/touch.c        |   16 ++++++++++------
- include/input.h    |    3 ++-
- include/inputstr.h |    1 +
- 3 files changed, 13 insertions(+), 7 deletions(-)
-
-diff --git a/dix/touch.c b/dix/touch.c
-index db0bf33..b42859d 100644
---- a/dix/touch.c
-+++ b/dix/touch.c
-@@ -697,12 +697,14 @@ TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource)
-  */
- void
- TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
--                 enum TouchListenerType type, enum TouchListenerState state)
-+                 enum TouchListenerType type, enum TouchListenerState state,
-+                 WindowPtr window)
- {
-     ti->listeners[ti->num_listeners].listener = resource;
-     ti->listeners[ti->num_listeners].level = level;
-     ti->listeners[ti->num_listeners].state = state;
-     ti->listeners[ti->num_listeners].type = type;
-+    ti->listeners[ti->num_listeners].window = window;
-     ti->num_listeners++;
- }
- 
-@@ -753,7 +755,7 @@ TouchAddGrabListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
-     }
- 
-     TouchAddListener(ti, grab->resource, grab->grabtype,
--                     type, LISTENER_AWAITING_BEGIN);
-+                     type, LISTENER_AWAITING_BEGIN, grab->window);
-     ti->num_grabs++;
- }
- 
-@@ -814,7 +816,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
-                 TouchEventHistoryAllocate(ti);
- 
-             TouchAddListener(ti, iclients->resource, XI2,
--                             type, LISTENER_AWAITING_BEGIN);
-+                             type, LISTENER_AWAITING_BEGIN, win);
-             return TRUE;
-         }
-     }
-@@ -830,7 +832,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
- 
-             TouchEventHistoryAllocate(ti);
-             TouchAddListener(ti, iclients->resource, XI,
--                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN);
-+                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
-+                             win);
-             return TRUE;
-         }
-     }
-@@ -845,7 +848,8 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
-         {
-             TouchEventHistoryAllocate(ti);
-             TouchAddListener(ti, win->drawable.id, CORE,
--                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN);
-+                             LISTENER_POINTER_REGULAR, LISTENER_AWAITING_BEGIN,
-+                             win);
-             return TRUE;
-         }
- 
-@@ -857,7 +861,7 @@ TouchAddRegularListener(DeviceIntPtr dev, TouchPointInfoPtr ti,
- 
-             TouchEventHistoryAllocate(ti);
-             TouchAddListener(ti, iclients->resource, CORE,
--                             type, LISTENER_AWAITING_BEGIN);
-+                             type, LISTENER_AWAITING_BEGIN, win);
-             return TRUE;
-         }
-     }
-diff --git a/include/input.h b/include/input.h
-index fb45617..53645b4 100644
---- a/include/input.h
-+++ b/include/input.h
-@@ -613,7 +613,8 @@ extern void TouchEventHistoryPush(TouchPointInfoPtr ti, const DeviceEvent *ev);
- extern void TouchEventHistoryReplay(TouchPointInfoPtr ti, DeviceIntPtr dev, XID resource);
- extern Bool TouchResourceIsOwner(TouchPointInfoPtr ti, XID resource);
- extern void TouchAddListener(TouchPointInfoPtr ti, XID resource, enum InputLevel level,
--                                     enum TouchListenerType type, enum TouchListenerState state);
-+                             enum TouchListenerType type, enum TouchListenerState state,
-+                             WindowPtr window);
- extern Bool TouchRemoveListener(TouchPointInfoPtr ti, XID resource);
- extern void TouchSetupListeners(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev);
- extern Bool TouchEnsureSprite(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
-diff --git a/include/inputstr.h b/include/inputstr.h
-index c3297db..4e28bc7 100644
---- a/include/inputstr.h
-+++ b/include/inputstr.h
-@@ -314,6 +314,7 @@ typedef struct _TouchPointInfo {
-         enum TouchListenerType type;
-         enum TouchListenerState state;
-         enum InputLevel level;      /* matters only for emulating touches */
-+        WindowPtr window;
-     } *listeners;
-     int         num_listeners;
-     int         num_grabs;          /* number of open grabs on this touch
--- 
-1.7.8.3
-
diff --git a/debian/patches/602-Factor-out-TouchEnd-generation-and-delivery.patch b/debian/patches/602-Factor-out-TouchEnd-generation-and-delivery.patch
deleted file mode 100644
index 1202d02..0000000
--- a/debian/patches/602-Factor-out-TouchEnd-generation-and-delivery.patch
+++ /dev/null
@@ -1,184 +0,0 @@
-From 19073425e5df1317f73f74ce0b95ab24e0e0da14 Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Fri, 3 Feb 2012 16:19:06 -0800
-Subject: [PATCH] Factor out TouchEnd generation and delivery
-
-The server often needs to generate and deliver TouchEnd events for
-circumstances including touch grab acceptance and rejection. This change
-refactors the code so it can be used more easily.
-
-Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
----
- Xi/exevents.c |  103 ++++++++++++++++++++------------------------------------
- 1 files changed, 37 insertions(+), 66 deletions(-)
-
-diff --git a/Xi/exevents.c b/Xi/exevents.c
-index 6b2db4b..218df2a 100644
---- a/Xi/exevents.c
-+++ b/Xi/exevents.c
-@@ -1089,17 +1089,46 @@ DeliverOneTouchEvent(ClientPtr client, DeviceIntPtr dev, TouchPointInfoPtr ti,
- }
- 
- /**
-- * If the current owner has rejected the event, deliver the
-- * TouchOwnership/TouchBegin to the next item in the sprite stack.
-+ * Generate and deliver a TouchEnd event.
-+ *
-+ * @param dev The device to deliver the event for.
-+ * @param ti The touch point record to deliver the event for.
-+ * @param flags Internal event flags. The called does not need to provide
-+ *        TOUCH_CLIENT_ID and TOUCH_POINTER_EMULATED, this function will ensure
-+ *        they are set appropriately.
-+ * @param resource The client resource to deliver to, or 0 for all clients.
-  */
- static void
--TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
--                     TouchOwnershipEvent *ev)
-+EmitTouchEnd(DeviceIntPtr dev, TouchPointInfoPtr ti, int flags, XID resource)
- {
-     InternalEvent *tel = InitEventList(GetMaximumEventsNum());
-     ValuatorMask *mask = valuator_mask_new(2);
-     int i, nev;
- 
-+    valuator_mask_set_double(mask, 0,
-+                             valuator_mask_get_double(ti->valuators, 0));
-+    valuator_mask_set_double(mask, 1,
-+                             valuator_mask_get_double(ti->valuators, 1));
-+
-+    flags |= TOUCH_CLIENT_ID;
-+    if (ti->emulate_pointer)
-+        flags |= TOUCH_POINTER_EMULATED;
-+    nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchEnd, flags, mask);
-+    for (i = 0; i < nev; i++)
-+        DeliverTouchEvents(dev, ti, tel + i, resource);
-+
-+    valuator_mask_free(&mask);
-+    FreeEventList(tel, GetMaximumEventsNum());
-+}
-+
-+/**
-+ * If the current owner has rejected the event, deliver the
-+ * TouchOwnership/TouchBegin to the next item in the sprite stack.
-+ */
-+static void
-+TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
-+                     TouchOwnershipEvent *ev)
-+{
-     /* Deliver the ownership */
-     if (ti->listeners[0].state == LISTENER_AWAITING_OWNER)
-         DeliverTouchEvents(dev, ti, (InternalEvent*)ev, ti->listeners[0].listener);
-@@ -1111,60 +1140,30 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
-     if (ti->num_listeners == 1 && ti->num_grabs == 0 &&
-             ti->pending_finish)
-     {
--        int flags;
--        valuator_mask_set_double(mask, 0,
--                                 valuator_mask_get_double(ti->valuators, 0));
--        valuator_mask_set_double(mask, 1,
--                                 valuator_mask_get_double(ti->valuators, 1));
--
--        flags = TOUCH_CLIENT_ID;
--        if (ti->emulate_pointer)
--            flags |= TOUCH_POINTER_EMULATED;
--        nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchEnd, flags, mask);
--        for (i = 0; i < nev; i++)
--            DeliverTouchEvents(dev, ti, tel + i, 0);
-+        EmitTouchEnd(dev, ti, 0, 0);
-         TouchEndTouch(dev, ti);
-     }
--
--    valuator_mask_free(&mask);
--    FreeEventList(tel, GetMaximumEventsNum());
- }
- 
- static void
- TouchEventRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
-                    TouchOwnershipEvent *ev)
- {
--    InternalEvent *tel = InitEventList(GetMaximumEventsNum());
--    ValuatorMask *mask = valuator_mask_new(2);
-     Bool was_owner = (ev->resource == ti->listeners[0].listener);
-     void *grab;
--    int nev, i;
- 
- 
-     /* Send a TouchEnd event to the resource being removed, but only if they
-      * haven't received one yet already */
-     if (ti->listeners[0].state != LISTENER_HAS_END)
--    {
--        int flags;
--        valuator_mask_set_double(mask, 0,
--                                 valuator_mask_get_double(ti->valuators, 0));
--        valuator_mask_set_double(mask, 1,
--                                 valuator_mask_get_double(ti->valuators, 1));
--
--        flags = TOUCH_CLIENT_ID|TOUCH_REJECT;
--        if (ti->emulate_pointer)
--            flags |= TOUCH_POINTER_EMULATED;
--        nev = GetTouchEvents(tel, sourcedev, ti->client_id, XI_TouchEnd, flags, mask);
--        for (i = 0; i < nev; i++)
--            DeliverTouchEvents(sourcedev, ti, tel + i, ev->resource);
--    }
-+        EmitTouchEnd(sourcedev, ti, TOUCH_REJECT, ev->resource);
- 
-     /* If there are no other listeners left, and the touchpoint is pending
-      * finish, then we can just kill it now. */
-     if (ti->num_listeners == 1 && ti->pending_finish)
-     {
-         TouchEndTouch(sourcedev, ti);
--        goto out;
-+        return;
-     }
- 
-     /* Remove the resource from the listener list, updating
-@@ -1180,10 +1179,6 @@ TouchEventRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
-      * the TouchOwnership or TouchBegin event to the new owner. */
-     if (ti->num_listeners > 0 && was_owner)
-         TouchPuntToNextOwner(sourcedev, ti, ev);
--
--out:
--    FreeEventList(tel, GetMaximumEventsNum());
--    valuator_mask_free(&mask);
- }
- 
- /**
-@@ -1201,33 +1196,9 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
-     if (ev->reason == XIRejectTouch)
-         TouchEventRejected(dev, ti, ev);
-     else if (ev->reason == XIAcceptTouch) {
--        int flags;
--        int nev, i;
--        ValuatorMask *mask;
--
--        InternalEvent *tel = InitEventList(GetMaximumEventsNum());
--
--        mask = valuator_mask_new(dev->valuator->numAxes);
--        valuator_mask_set_double(mask, 0,
--                                 valuator_mask_get_double(ti->valuators, 0));
--        valuator_mask_set_double(mask, 1,
--                                 valuator_mask_get_double(ti->valuators, 1));
--
--        /* FIXME: what about early acceptance? a client may accept before it
--         * owns the touch. */
--
-         /* The touch owner has accepted the touch.  Send TouchEnd events to
-          * everyone else, and truncate the list of listeners. */
--        flags = TOUCH_ACCEPT|TOUCH_CLIENT_ID;
--        if (ti->emulate_pointer)
--            flags |= TOUCH_POINTER_EMULATED;
--        nev = GetTouchEvents(tel, dev, ti->client_id, XI_TouchEnd,
--                             flags, mask);
--        for (i = 0; i < nev; i++)
--            DeliverTouchEvents(dev, ti, tel + i, 0);
--
--        FreeEventList(tel, GetMaximumEventsNum());
--        valuator_mask_free(&mask);
-+        EmitTouchEnd(dev, ti, TOUCH_ACCEPT, 0);
- 
-         while (ti->num_listeners > 1)
-             TouchRemoveListener(ti, ti->listeners[1].listener);
--- 
-1.7.8.3
-
diff --git a/debian/patches/603-Export-TouchEventRejected-as-TouchRejected.patch b/debian/patches/603-Export-TouchEventRejected-as-TouchRejected.patch
deleted file mode 100644
index 5701ece..0000000
--- a/debian/patches/603-Export-TouchEventRejected-as-TouchRejected.patch
+++ /dev/null
@@ -1,115 +0,0 @@
-From 192b2c9a2ec04522655675ddfe71de5cf974cc7b Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Fri, 3 Feb 2012 16:19:07 -0800
-Subject: [PATCH] Export TouchEventRejected as TouchRejected
-
-This function is mostly correct for early reject usage. With a small
-change to pass the client resource explicitly and making the
-TouchOwnership event optional, it is usable for all rejection scenarios.
-This change exports it for use outside Xi/exevents.c and modifies the
-name accordingly.
-
-Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
----
- Xi/exevents.c      |   38 +++++++++++++++++++++++++++-----------
- include/exevents.h |    7 +++++++
- 2 files changed, 34 insertions(+), 11 deletions(-)
-
-diff --git a/Xi/exevents.c b/Xi/exevents.c
-index 218df2a..b0832d0 100644
---- a/Xi/exevents.c
-+++ b/Xi/exevents.c
-@@ -1145,18 +1145,34 @@ TouchPuntToNextOwner(DeviceIntPtr dev, TouchPointInfoPtr ti,
-     }
- }
- 
--static void
--TouchEventRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
--                   TouchOwnershipEvent *ev)
-+/**
-+ * Process a touch rejection.
-+ *
-+ * @param sourcedev The source device of the touch sequence.
-+ * @param ti The touchpoint info record.
-+ * @param resource The resource of the client rejecting the touch.
-+ * @param ev TouchOwnership event to send. Set to NULL if no event should be
-+ *        sent.
-+ */
-+void
-+TouchRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti, XID resource,
-+              TouchOwnershipEvent *ev)
- {
--    Bool was_owner = (ev->resource == ti->listeners[0].listener);
-+    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
-      * haven't received one yet already */
--    if (ti->listeners[0].state != LISTENER_HAS_END)
--        EmitTouchEnd(sourcedev, ti, TOUCH_REJECT, ev->resource);
-+    for (i = 0; i < ti->num_listeners; i++)
-+    {
-+        if (ti->listeners[i].listener == resource)
-+        {
-+            if (ti->listeners[i].state != LISTENER_HAS_END)
-+                EmitTouchEnd(sourcedev, ti, TOUCH_REJECT, resource);
-+            break;
-+        }
-+    }
- 
-     /* If there are no other listeners left, and the touchpoint is pending
-      * finish, then we can just kill it now. */
-@@ -1168,16 +1184,16 @@ TouchEventRejected(DeviceIntPtr sourcedev, TouchPointInfoPtr ti,
- 
-     /* 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, ev->resource))
-+    if (TouchRemoveListener(ti, resource))
-     {
--        if (dixLookupResourceByType(&grab, ev->resource, RT_PASSIVEGRAB,
-+        if (dixLookupResourceByType(&grab, resource, RT_PASSIVEGRAB,
-                                     serverClient, DixGetAttrAccess) == Success)
-             ti->num_grabs--;
-     }
- 
-     /* If the current owner was removed and there are further listeners, deliver
-      * the TouchOwnership or TouchBegin event to the new owner. */
--    if (ti->num_listeners > 0 && was_owner)
-+    if (ev && ti->num_listeners > 0 && was_owner)
-         TouchPuntToNextOwner(sourcedev, ti, ev);
- }
- 
-@@ -1194,7 +1210,7 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
- {
- 
-     if (ev->reason == XIRejectTouch)
--        TouchEventRejected(dev, ti, ev);
-+        TouchRejected(dev, ti, ev->resource, ev);
-     else if (ev->reason == XIAcceptTouch) {
-         /* The touch owner has accepted the touch.  Send TouchEnd events to
-          * everyone else, and truncate the list of listeners. */
-diff --git a/include/exevents.h b/include/exevents.h
-index 31acb30..fb2ef27 100644
---- a/include/exevents.h
-+++ b/include/exevents.h
-@@ -323,6 +323,13 @@ SendEventToAllWindows(
-         xEvent *               /* ev */,
-         int                    /* count */);
- 
-+extern void
-+TouchRejected(
-+        DeviceIntPtr           /* sourcedev */,
-+        TouchPointInfoPtr      /* ti */,
-+        XID                    /* resource */,
-+        TouchOwnershipEvent *  /* ev */);
-+
- extern _X_HIDDEN void XI2EventSwap(
-         xGenericEvent  *              /* from */,
-         xGenericEvent  *              /* to */);
--- 
-1.7.8.3
-
diff --git a/debian/patches/604-Move-AllowTouch-to-dix-touch.c-and-rename-to-TouchAc.patch b/debian/patches/604-Move-AllowTouch-to-dix-touch.c-and-rename-to-TouchAc.patch
deleted file mode 100644
index 62207be..0000000
--- a/debian/patches/604-Move-AllowTouch-to-dix-touch.c-and-rename-to-TouchAc.patch
+++ /dev/null
@@ -1,155 +0,0 @@
-From 9a260e9af83feb5c53ffd3b2da2dc3adf06240a1 Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Fri, 3 Feb 2012 16:19:08 -0800
-Subject: [PATCH] Move AllowTouch to dix/touch.c, and rename to
- TouchAcceptReject
-
-Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
----
- Xi/xiallowev.c  |   46 ++--------------------------------------------
- dix/touch.c     |   45 +++++++++++++++++++++++++++++++++++++++++++++
- include/input.h |    2 ++
- 3 files changed, 49 insertions(+), 44 deletions(-)
-
-diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
-index a4b2f57..dab3393 100644
---- a/Xi/xiallowev.c
-+++ b/Xi/xiallowev.c
-@@ -57,47 +57,6 @@ SProcXIAllowEvents(ClientPtr client)
-     return ProcXIAllowEvents(client);
- }
- 
--static int
--AllowTouch(ClientPtr client, DeviceIntPtr dev, int mode, uint32_t touchid, XID *error)
--{
--    TouchPointInfoPtr ti;
--    int nev, i;
--    InternalEvent *events = InitEventList(GetMaximumEventsNum());
--
--    if (!events)
--        return BadAlloc;
--
--    if (!dev->touch)
--    {
--        *error = dev->id;
--        return BadDevice;
--    }
--
--    /* FIXME window is unhandled */
--
--    ti = TouchFindByClientID(dev, touchid);
--    if (!ti)
--    {
--        *error = touchid;
--        return BadValue;
--    }
--
--    /* FIXME: Allow for early accept */
--    if (ti->num_listeners == 0 || CLIENT_ID(ti->listeners[0].listener) != client->index)
--        return BadAccess;
--
--    nev = GetTouchOwnershipEvents(events, dev, ti, mode, ti->listeners[0].listener, 0);
--    if (nev == 0)
--        return BadAlloc;
--    for (i = 0; i < nev; i++)
--        mieqProcessDeviceEvent(dev, events + i, NULL);
--
--    ProcessInputEvents();
--
--    FreeEventList(events, GetMaximumEventsNum());
--    return Success;
--}
--
- int
- ProcXIAllowEvents(ClientPtr client)
- {
-@@ -138,9 +97,8 @@ ProcXIAllowEvents(ClientPtr client)
- 	break;
-     case XIRejectTouch:
-     case XIAcceptTouch:
--        ret = AllowTouch(client, dev,
--                         stuff->mode, stuff->touchid,
--                         &client->errorValue);
-+        ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
-+                                &client->errorValue);
-         break;
-     default:
- 	client->errorValue = stuff->mode;
-diff --git a/dix/touch.c b/dix/touch.c
-index b42859d..4a116ee 100644
---- a/dix/touch.c
-+++ b/dix/touch.c
-@@ -34,6 +34,7 @@
- 
- #include "eventstr.h"
- #include "exevents.h"
-+#include "exglobals.h"
- #include "inpututils.h"
- #include "eventconvert.h"
- #include "windowstr.h"
-@@ -984,3 +985,47 @@ TouchListenerGone(XID resource)
- 
-     FreeEventList(events, GetMaximumEventsNum());
- }
-+
-+int
-+TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
-+                  uint32_t touchid, XID *error)
-+{
-+    TouchPointInfoPtr ti;
-+    int nev, i;
-+    InternalEvent *events = InitEventList(GetMaximumEventsNum());
-+
-+    if (!events)
-+        return BadAlloc;
-+
-+    if (!dev->touch)
-+    {
-+        *error = dev->id;
-+        return BadDevice;
-+    }
-+
-+    /* FIXME window is unhandled */
-+
-+    ti = TouchFindByClientID(dev, touchid);
-+    if (!ti)
-+    {
-+        *error = touchid;
-+        return BadValue;
-+    }
-+
-+    /* FIXME: Allow for early accept */
-+    if (ti->num_listeners == 0 ||
-+        CLIENT_ID(ti->listeners[0].listener) != client->index)
-+        return BadAccess;
-+
-+    nev = GetTouchOwnershipEvents(events, dev, ti, mode,
-+                                  ti->listeners[0].listener, 0);
-+    if (nev == 0)
-+        return BadAlloc;
-+    for (i = 0; i < nev; i++)
-+        mieqProcessDeviceEvent(dev, events + i, NULL);
-+
-+    ProcessInputEvents();
-+
-+    FreeEventList(events, GetMaximumEventsNum());
-+    return Success;
-+}
-diff --git a/include/input.h b/include/input.h
-index 53645b4..605e74d 100644
---- a/include/input.h
-+++ b/include/input.h
-@@ -625,6 +625,8 @@ extern int TouchConvertToPointerEvent(const InternalEvent *ev,
- extern int TouchGetPointerEventType(const InternalEvent *ev);
- extern void TouchRemovePointerGrab(DeviceIntPtr dev);
- extern void TouchListenerGone(XID resource);
-+extern int TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
-+                             uint32_t touchid, XID *error);
- 
- /* misc event helpers */
- extern Mask GetEventMask(DeviceIntPtr dev, xEvent* ev, InputClientsPtr clients);
--- 
-1.7.8.3
-
diff --git a/debian/patches/605-Check-for-proper-window-ID-when-processing-touch-all.patch b/debian/patches/605-Check-for-proper-window-ID-when-processing-touch-all.patch
deleted file mode 100644
index 0f328a6..0000000
--- a/debian/patches/605-Check-for-proper-window-ID-when-processing-touch-all.patch
+++ /dev/null
@@ -1,87 +0,0 @@
-From 656ab879f20892975510723ce8fe78faf64aadb4 Mon Sep 17 00:00:00 2001
-From: Chase Douglas <chase.douglas@canonical.com>
-Date: Fri, 3 Feb 2012 16:19:09 -0800
-Subject: [PATCH] Check for proper window ID when processing touch allow
- requests
-
-Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
-Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
----
- Xi/xiallowev.c  |    2 +-
- dix/touch.c     |   18 ++++++++++++------
- include/input.h |    2 +-
- 3 files changed, 14 insertions(+), 8 deletions(-)
-
-diff --git a/Xi/xiallowev.c b/Xi/xiallowev.c
-index dab3393..38967b2 100644
---- a/Xi/xiallowev.c
-+++ b/Xi/xiallowev.c
-@@ -98,7 +98,7 @@ ProcXIAllowEvents(ClientPtr client)
-     case XIRejectTouch:
-     case XIAcceptTouch:
-         ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
--                                &client->errorValue);
-+                                stuff->grab_window, &client->errorValue);
-         break;
-     default:
- 	client->errorValue = stuff->mode;
-diff --git a/dix/touch.c b/dix/touch.c
-index 4a116ee..7daf81b 100644
---- a/dix/touch.c
-+++ b/dix/touch.c
-@@ -988,7 +988,7 @@ TouchListenerGone(XID resource)
- 
- int
- TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
--                  uint32_t touchid, XID *error)
-+                  uint32_t touchid, Window grab_window, XID *error)
- {
-     TouchPointInfoPtr ti;
-     int nev, i;
-@@ -1003,8 +1003,6 @@ TouchAcceptReject(ClientPtr client, DeviceIntPtr dev, int mode,
-         return BadDevice;
-     }
- 


Reply to: