diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2011-10-26 11:14:04 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2011-11-11 15:50:36 +1000 |
commit | 239e972be1f2c6a984dd6c5aecce710d0b866257 (patch) | |
tree | b1c8cf4dff1312bd2ec34ad4291226a24c5bbda9 | |
parent | 6127923fe0d50cb9b9ac4ae0a3876ba6f180137c (diff) |
Simplify a condition, only the event type differs here
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | src/evdev.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/src/evdev.c b/src/evdev.c index 4291343..97da9c8 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -704,20 +704,23 @@ static void EvdevProcessTouch(InputInfoPtr pInfo) { EvdevPtr pEvdev = pInfo->private; + int type; if (pEvdev->cur_slot < 0 || !pEvdev->mt_mask) return; - if (pEvdev->close_slot) { - EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, - XI_TouchEnd); - pEvdev->close_slot = 0; - } else { - EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, - pEvdev->open_slot ? XI_TouchBegin : - XI_TouchUpdate); - pEvdev->open_slot = 0; - } + if (pEvdev->close_slot) + type = XI_TouchEnd; + else if (pEvdev->open_slot) + type = XI_TouchBegin; + else + type = XI_TouchUpdate; + + + EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, type); + + pEvdev->close_slot = 0; + pEvdev->open_slot = 0; valuator_mask_zero(pEvdev->mt_mask); } |