diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2011-01-10 18:13:52 +0100 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2011-01-10 18:13:52 +0100 |
commit | cf1ffc9a1a1f2cfa58605bf21b6453a7fc0ddefe (patch) | |
tree | dc3e9c022dae4c6778569a54ec8f1a01a4e40bfd | |
parent | cc6902cff106e97d569385fc0af8779e26b2eb4a (diff) |
valuator mask/values: wrong assumption fixed
-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); |