diff options
-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); } |