[PATCH xserver 10/10] test: input - set all touch events at once
Daniel Stone
daniel at fooishbar.org
Fri Dec 17 09:13:35 PST 2010
From: Chase Douglas <chase.douglas at canonical.com>
Clients can't select for the three touch events individually, so ensure
the test doesn't try to do so.
Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Daniel Stone <daniel at fooishbar.org>
---
test/xi2/protocol-xiselectevents.c | 44 ++++++++++++++++++++++++++++++++++++
1 files changed, 44 insertions(+), 0 deletions(-)
diff --git a/test/xi2/protocol-xiselectevents.c b/test/xi2/protocol-xiselectevents.c
index fe1c26d..b6ae1cb 100644
--- a/test/xi2/protocol-xiselectevents.c
+++ b/test/xi2/protocol-xiselectevents.c
@@ -159,7 +159,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
memset(bits, 0, mask->mask_len * 4);
for (j = 0; j <= XI_LASTEVENT; j++)
{
+ /* Can't select for these events alone */
+ if (j == XI_TouchMotion || j == XI_TouchEnd)
+ continue;
+
SetBit(bits, j);
+
+ /* Must select for all touch events at once */
+ if (j == XI_TouchBegin) {
+ SetBit(bits, XI_TouchMotion);
+ SetBit(bits, XI_TouchEnd);
+ }
+
request_XISelectEvent(req, Success);
ClearBit(bits, j);
}
@@ -175,7 +186,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
for (j = 0; j <= XI_LASTEVENT; j++)
{
+ /* Can't select for these events alone */
+ if (j == XI_TouchMotion || j == XI_TouchEnd)
+ continue;
+
SetBit(bits, j);
+
+ /* Must select for all touch events at once */
+ if (j == XI_TouchBegin) {
+ SetBit(bits, XI_TouchMotion);
+ SetBit(bits, XI_TouchEnd);
+ }
+
request_XISelectEvent(req, Success);
}
@@ -189,7 +211,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
for (j = XI_LASTEVENT + 1; j < mask->mask_len * 4; j++)
{
+ /* Can't select for these events alone */
+ if (j == XI_TouchMotion || j == XI_TouchEnd)
+ continue;
+
SetBit(bits, j);
+
+ /* Must select for all touch events at once */
+ if (j == XI_TouchBegin) {
+ SetBit(bits, XI_TouchMotion);
+ SetBit(bits, XI_TouchEnd);
+ }
+
request_XISelectEvent(req, BadValue);
ClearBit(bits, j);
}
@@ -202,7 +235,18 @@ static void request_XISelectEvents_masks(xXISelectEventsReq *req)
memset(bits, 0, mask->mask_len * 4);
for (j = 0; j <= XI_LASTEVENT; j++)
{
+ /* Can't select for these events alone */
+ if (j == XI_TouchMotion || j == XI_TouchEnd)
+ continue;
+
SetBit(bits, j);
+
+ /* Must select for all touch events at once */
+ if (j == XI_TouchBegin) {
+ SetBit(bits, XI_TouchMotion);
+ SetBit(bits, XI_TouchEnd);
+ }
+
request_XISelectEvent(req, Success);
}
--
1.7.2.3
More information about the xorg-devel
mailing list