~ubuntu-branches/ubuntu/quantal/xorg-server/quantal-updates

« back to all changes in this revision

Viewing changes to debian/patches/501_touch_accept_end.patch

  • Committer: Package Import Robot
  • Author(s): Chase Douglas
  • Date: 2012-03-07 15:36:20 UTC
  • Revision ID: package-import@ubuntu.com-20120307153620-v2789zwz1n3irs3b
Tags: 2:1.11.4-0ubuntu5
* 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
* Fix indirect touch grab handling (LP: #929408)
  - Add temporary patch 501_touch_accept_end.patch
  - Add temporary patch 502_indirect_touch_window_set.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From 40cd6abb66787c79465cda03c17297a06d1cd848 Mon Sep 17 00:00:00 2001
 
2
From: Chase Douglas <chase.douglas@canonical.com>
 
3
Date: Fri, 2 Mar 2012 14:40:07 -0800
 
4
Subject: [PATCH 1/2] Xi: Fix TouchEnd to TouchUpdate change for one accepted
 
5
 grab
 
6
 
 
7
If there is only one listener of a touch, the listener is a grab, and is
 
8
accepted before the touch has ended, the current code will not end the
 
9
touch record when the touch does end.
 
10
 
 
11
This change adds a listener state for when a touch is accepted but has
 
12
not yet ended. We now keep the touch record alive in this state, but end
 
13
it when the touch ends.
 
14
 
 
15
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
 
16
---
 
17
 Xi/exevents.c   |   25 ++++++++++++++++---------
 
18
 include/input.h |    3 ++-
 
19
 2 files changed, 18 insertions(+), 10 deletions(-)
 
20
 
 
21
diff --git a/Xi/exevents.c b/Xi/exevents.c
 
22
index f390f67..d71e604 100644
 
23
--- a/Xi/exevents.c
 
24
+++ b/Xi/exevents.c
 
25
@@ -1252,6 +1252,8 @@ ProcessTouchOwnershipEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
 
26
         /* Owner accepted after receiving end */
 
27
         if (ti->listeners[0].state == LISTENER_HAS_END)
 
28
             TouchEndTouch(dev, ti);
 
29
+        else
 
30
+            ti->listeners[0].state = LISTENER_HAS_ACCEPTED;
 
31
     } else { /* this is the very first ownership event for a grab */
 
32
         DeliverTouchEvents(dev, ti, (InternalEvent*)ev, ev->resource);
 
33
     }
 
34
@@ -1781,7 +1783,11 @@ DeliverTouchBeginEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev
 
35
     {
 
36
         if (has_ownershipmask)
 
37
             TouchSendOwnershipEvent(dev, ti, 0, listener->listener);
 
38
-        state = LISTENER_IS_OWNER;
 
39
+
 
40
+        if (!has_ownershipmask || listener->type == LISTENER_REGULAR)
 
41
+            state = LISTENER_HAS_ACCEPTED;
 
42
+        else
 
43
+            state = LISTENER_IS_OWNER;
 
44
     }
 
45
     listener->state = state;
 
46
 
 
47
@@ -1812,22 +1818,23 @@ DeliverTouchEndEvent(DeviceIntPtr dev, TouchPointInfoPtr ti, InternalEvent *ev,
 
48
         listener->state = LISTENER_HAS_END;
 
49
     } else if (TouchResourceIsOwner(ti, listener->listener))
 
50
     {
 
51
+        Bool normal_end = !(ev->device_event.flags & TOUCH_ACCEPT);
 
52
+
 
53
         /* FIXME: what about early acceptance */
 
54
-        if (!(ev->device_event.flags & TOUCH_ACCEPT))
 
55
-        {
 
56
-            if (listener->state != LISTENER_HAS_END)
 
57
-                rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
 
58
-            listener->state = LISTENER_HAS_END;
 
59
-        }
 
60
+        if (normal_end && listener->state != LISTENER_HAS_END)
 
61
+            rc = DeliverOneTouchEvent(client, dev, ti, grab, win, ev);
 
62
+
 
63
         if ((ti->num_listeners > 1 ||
 
64
-             (listener->type == LISTENER_GRAB &&
 
65
-              xi2mask_isset(xi2mask, dev, XI_TouchOwnership))) &&
 
66
+             listener->state != LISTENER_HAS_ACCEPTED) &&
 
67
             (ev->device_event.flags & (TOUCH_ACCEPT|TOUCH_REJECT)) == 0)
 
68
         {
 
69
             ev->any.type = ET_TouchUpdate;
 
70
             ev->device_event.flags |= TOUCH_PENDING_END;
 
71
             ti->pending_finish = TRUE;
 
72
         }
 
73
+
 
74
+        if (normal_end)
 
75
+            listener->state = LISTENER_HAS_END;
 
76
     }
 
77
 
 
78
 out:
 
79
diff --git a/include/input.h b/include/input.h
 
80
index b7825a7..1e9e0fd 100644
 
81
--- a/include/input.h
 
82
+++ b/include/input.h
 
83
@@ -585,7 +585,8 @@ enum TouchListenerState{
 
84
     LISTENER_AWAITING_OWNER,       /**< Waiting for a TouchOwnership event */
 
85
     LISTENER_EARLY_ACCEPT,         /**< Waiting for ownership, has already
 
86
                                         accepted */
 
87
-    LISTENER_IS_OWNER,             /**< Is the current owner */
 
88
+    LISTENER_IS_OWNER,             /**< Is the current owner, hasn't accepted */
 
89
+    LISTENER_HAS_ACCEPTED,         /**< Is the current owner, has accepted */
 
90
     LISTENER_HAS_END,              /**< Has already received the end event */
 
91
 };
 
92
 
 
93
-- 
 
94
1.7.9
 
95