summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenrik Rydberg <rydberg@euromail.se>2011-01-10 17:37:49 +0100
committerHenrik Rydberg <rydberg@euromail.se>2011-01-10 17:37:49 +0100
commite41f3eb103c9e4c568151f9ef1703a69016548e5 (patch)
treea2719cdba10e79d76ced672b5ec2c2a0452309b0
parent590e18fbef116edd526493706bcfbd400d25adf3 (diff)
two minor fixes, still same problem
-rw-r--r--src/frame-xi2.c2
-rw-r--r--tools/utouch-frame-test-xi2.c12
2 files changed, 9 insertions, 5 deletions
diff --git a/src/frame-xi2.c b/src/frame-xi2.c
index bf83c6c..c10aee9 100644
--- a/src/frame-xi2.c
+++ b/src/frame-xi2.c
@@ -161,7 +161,7 @@ static float touch_angle(utouch_frame_handle fh, int orient)
static int handle_event(utouch_frame_handle fh,
struct utouch_contact *slot,
- int ix, int value)
+ int ix, float value)
{
switch (fh->evmap[ix]) {
case ABS_MT_POSITION_X:
diff --git a/tools/utouch-frame-test-xi2.c b/tools/utouch-frame-test-xi2.c
index 65adce3..079a6a9 100644
--- a/tools/utouch-frame-test-xi2.c
+++ b/tools/utouch-frame-test-xi2.c
@@ -30,6 +30,8 @@
#include <unistd.h>
#include <fcntl.h>
+static int xi_opcode;
+
struct frame_test {
Display *display;
Window root, win;
@@ -41,11 +43,15 @@ static int init_xi2(struct frame_test *test, int id)
{
Display *dpy;
int ndevices, i;
+ int event, error;
dpy = XOpenDisplay(NULL);
if (!dpy)
return -1;
+ if (!XQueryExtension(dpy, "XInputExtension", &xi_opcode, &event, &error))
+ return -1;
+
test->display = dpy;
test->info = XIQueryDevice(dpy, XIAllDevices, &ndevices);
test->dev = 0;
@@ -158,8 +164,6 @@ static void loop_device(struct frame_test *test)
XISetMask(mask.mask, XI_TouchEnd);
XISelectEvents(test->display, test->win, &mask, 1);
- XSelectInput(test->display, test->win, ExposureMask);
-
while (1) {
XEvent ev;
XIDeviceEvent *event = (void*)&ev;
@@ -167,8 +171,8 @@ static void loop_device(struct frame_test *test)
XNextEvent(test->display, &ev);
if (XGetEventData(test->display, cookie) &&
- cookie->type == GenericEvent) {
- // should have that opcode as well
+ cookie->type == GenericEvent &&
+ cookie->extension == xi_opcode) {
frame = utouch_frame_pump_xi2(test->fh, cookie->data);
if (frame)
report_frame(frame);