Skip to content

Commit

Permalink
Grab the device on startup
Browse files Browse the repository at this point in the history
This is iffy with current servers, they won't actually give us the second
(simultaneous) touchpoint. Still, better than not grabbing it.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
  • Loading branch information
whot committed Jul 23, 2013
1 parent 75fdc11 commit 5695869
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tools/mtview.c
Original file line number Diff line number Diff line change
Expand Up @@ -741,24 +741,22 @@ static int run_mtdev_xi2(int deviceid)
XISetMask(mask.mask, XI_TouchBegin);
XISetMask(mask.mask, XI_TouchUpdate);
XISetMask(mask.mask, XI_TouchEnd);
XISelectEvents(w.dsp, w.win, &mask, 1);

while(1) {
XEvent xev;
XNextEvent(w.dsp, &xev);
if (xev.type == ConfigureNotify) {
set_screen_size_mtdev(&w, &xev);
} else if (xev.type == Expose) {
#if 0
/* FIXME: server bug? grab doesn't grab the next
touchpoint?? */
if (XIGrabDevice(w.dsp, deviceid, w.win, CurrentTime, None,
static int grabbed = 0;
if (!grabbed &&
XIGrabDevice(w.dsp, deviceid, w.win, CurrentTime, None,
GrabModeAsync, GrabModeAsync,
False, &mask) != Success) {
error("Failed to grab device\n");
return 1;
}
#endif
} else
grabbed = 1;
}
else if (xev.type == GenericEvent) {
handle_xi2_event(w.dsp, &xev, &touch_info);
Expand Down

0 comments on commit 5695869

Please sign in to comment.