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

« back to all changes in this revision

Viewing changes to debian/patches/609-Xi-handle-new-XIAllowEvents-request-in-inputproto-2..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 ceb026c6a6f1eea8b34e745f06f1ebcd652c0ba1 Mon Sep 17 00:00:00 2001
2
 
From: Peter Hutterer <peter.hutterer@who-t.net>
3
 
Date: Fri, 27 Jan 2012 12:41:09 +1000
4
 
Subject: [PATCH] Xi: handle new XIAllowEvents request in inputproto 2.1.99.6
5
 
 
6
 
grab_window and touchid were removed from the struct for ABI compatibility
7
 
reasons, we need to pull in the new, XI 2.2-specific struct.
8
 
 
9
 
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
10
 
---
11
 
 Xi/xiallowev.c |   41 +++++++++++++++++++++++++++++++++++------
12
 
 configure.ac   |    2 +-
13
 
 2 files changed, 36 insertions(+), 7 deletions(-)
14
 
 
15
 
Index: xorg-server/Xi/xiallowev.c
16
 
===================================================================
17
 
--- xorg-server.orig/Xi/xiallowev.c     2012-02-11 00:19:36.000000000 +0100
18
 
+++ xorg-server/Xi/xiallowev.c  2012-02-11 00:20:41.372346001 +0100
19
 
@@ -41,6 +41,7 @@
20
 
 #include <X11/extensions/XI2proto.h>
21
 
 
22
 
 #include "exglobals.h" /* BadDevice */
23
 
+#include "exevents.h"
24
 
 #include "xiallowev.h"
25
 
 
26
 
 int
27
 
@@ -53,8 +54,12 @@ SProcXIAllowEvents(ClientPtr client)
28
 
     swaps(&stuff->length, n);
29
 
     swaps(&stuff->deviceid, n);
30
 
     swapl(&stuff->time, n);
31
 
-    /* FIXME swap touchid */
32
 
-    /* FIXME swap window */
33
 
+    if (stuff->length > 3)
34
 
+    {
35
 
+        xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq*)stuff;
36
 
+        swapl(&req_xi22->touchid, n);
37
 
+        swapl(&req_xi22->grab_window, n);
38
 
+    }
39
 
 
40
 
     return ProcXIAllowEvents(client);
41
 
 }
42
 
@@ -65,9 +70,21 @@ ProcXIAllowEvents(ClientPtr client)
43
 
     TimeStamp time;
44
 
     DeviceIntPtr dev;
45
 
     int ret = Success;
46
 
-
47
 
-    REQUEST(xXIAllowEventsReq);
48
 
-    /* FIXME: check request length, 12 for XI 2.0+, 20 for XI 2.2+ */
49
 
+    XIClientPtr xi_client;
50
 
+    Bool have_xi22 = FALSE;
51
 
+    REQUEST(xXI2_2AllowEventsReq);
52
 
+
53
 
+    xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
54
 
+
55
 
+    if (version_compare(xi_client->major_version,
56
 
+                        xi_client->minor_version, 2, 2) >= 0)
57
 
+    {
58
 
+        REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
59
 
+        have_xi22 = TRUE;
60
 
+    } else
61
 
+    {
62
 
+        REQUEST_SIZE_MATCH(xXIAllowEventsReq);
63
 
+    }
64
 
 
65
 
     ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
66
 
     if (ret != Success)
67
 
@@ -99,8 +116,20 @@ ProcXIAllowEvents(ClientPtr client)
68
 
        break;
69
 
     case XIRejectTouch:
70
 
     case XIAcceptTouch:
71
 
-        ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
72
 
-                                stuff->grab_window, &client->errorValue);
73
 
+        {
74
 
+            int rc;
75
 
+            WindowPtr win;
76
 
+
77
 
+            if (!have_xi22)
78
 
+                return BadValue;
79
 
+
80
 
+            rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess);
81
 
+            if (rc != Success)
82
 
+                return rc;
83
 
+
84
 
+            ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
85
 
+                                    stuff->grab_window, &client->errorValue);
86
 
+        }
87
 
         break;
88
 
     default:
89
 
        client->errorValue = stuff->mode;
90
 
Index: xorg-server/configure.ac
91
 
===================================================================
92
 
--- xorg-server.orig/configure.ac       2012-02-11 00:19:36.000000000 +0100
93
 
+++ xorg-server/configure.ac    2012-02-11 00:20:18.960345999 +0100
94
 
@@ -790,7 +790,7 @@ WINDOWSWMPROTO="windowswmproto"
95
 
 APPLEWMPROTO="applewmproto >= 1.4"
96
 
 
97
 
 dnl Core modules for most extensions, et al.
98
 
-SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 2.1.99.5] [kbproto >= 1.0.3] fontsproto"
99
 
+SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 2.1.99.6] [kbproto >= 1.0.3] fontsproto"
100
 
 # Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
101
 
 AC_SUBST(SDK_REQUIRED_MODULES)
102