From 239e972be1f2c6a984dd6c5aecce710d0b866257 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Oct 2011 11:14:04 +1000 Subject: Simplify a condition, only the event type differs here Signed-off-by: Peter Hutterer --- src/evdev.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3