diff options
-rw-r--r-- | src/frame-xi2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/frame-xi2.c b/src/frame-xi2.c index 6a5eac0..c4fb176 100644 --- a/src/frame-xi2.c +++ b/src/frame-xi2.c @@ -272,7 +272,7 @@ utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) int touchid = ev->detail; int nbyte = ev->valuators.mask_len; int nbit = nbyte << 3; - int i; + int num, i; switch (ev->evtype) { case XI_TouchBegin: @@ -280,9 +280,10 @@ utouch_frame_pump_xi2(utouch_frame_handle fh, const XIDeviceEvent *ev) case XI_TouchEnd: utouch_frame_set_current_id(fh, touchid); slot = utouch_frame_get_current_slot(fh); + num = 0; for (i = 0; i < nbit; i++) if (XIMaskIsSet(mask, i)) - handle_event(fh, slot, i, value[i]); + handle_event(fh, slot, i, value[num++]); if (ev->evtype == XI_TouchEnd) utouch_frame_get_current_slot(fh)->id = -1; return utouch_frame_sync(fh, ev->time); |