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
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.
9
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
11
Xi/xiallowev.c | 41 +++++++++++++++++++++++++++++++++++------
13
2 files changed, 36 insertions(+), 7 deletions(-)
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
20
#include <X11/extensions/XI2proto.h>
22
#include "exglobals.h" /* BadDevice */
23
+#include "exevents.h"
24
#include "xiallowev.h"
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)
35
+ xXI2_2AllowEventsReq *req_xi22 = (xXI2_2AllowEventsReq*)stuff;
36
+ swapl(&req_xi22->touchid, n);
37
+ swapl(&req_xi22->grab_window, n);
40
return ProcXIAllowEvents(client);
42
@@ -65,9 +70,21 @@ ProcXIAllowEvents(ClientPtr client)
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);
53
+ xi_client = dixLookupPrivate(&client->devPrivates, XIClientPrivateKey);
55
+ if (version_compare(xi_client->major_version,
56
+ xi_client->minor_version, 2, 2) >= 0)
58
+ REQUEST_AT_LEAST_SIZE(xXI2_2AllowEventsReq);
62
+ REQUEST_SIZE_MATCH(xXIAllowEventsReq);
65
ret = dixLookupDevice(&dev, stuff->deviceid, client, DixGetAttrAccess);
67
@@ -99,8 +116,20 @@ ProcXIAllowEvents(ClientPtr client)
71
- ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
72
- stuff->grab_window, &client->errorValue);
80
+ rc = dixLookupWindow(&win, stuff->grab_window, client, DixReadAccess);
84
+ ret = TouchAcceptReject(client, dev, stuff->mode, stuff->touchid,
85
+ stuff->grab_window, &client->errorValue);
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"
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)