1
From 23e87b57bb874326c88a7ad7292bec51959fb876 Mon Sep 17 00:00:00 2001
2
From: Chase Douglas <chase.douglas@canonical.com>
3
Date: Mon, 14 May 2012 10:20:01 -0700
4
Subject: [PATCH 2/6] Ignore pre-existing touches
6
If a touch is physically active when the device is enabled, then all
7
events for that touch must be ignored. In particular, we cannot close
8
the touch or we will decrement touch count counters below zero. If these
9
counters go below zero memory corruption can occur.
11
Note that a device is disabled and enabled every time the user types on
12
the keyboard if synclient is used to disable the trackpad while typing.
13
This is a very common option.
15
Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
16
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
17
(cherry picked from commit 55fc42e7c9b4948cadd4f98ef7b6a3b12e268e3e)
19
src/eventcomm.c | 5 ++---
20
1 file changed, 2 insertions(+), 3 deletions(-)
22
diff --git a/src/eventcomm.c b/src/eventcomm.c
23
index 89a8a3a..280ef9b 100644
26
@@ -564,8 +564,7 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
30
- if (hw->slot_state[slot_index] == SLOTSTATE_EMPTY ||
31
- hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY)
32
+ if (hw->slot_state[slot_index] == SLOTSTATE_OPEN_EMPTY)
33
hw->slot_state[slot_index] = SLOTSTATE_UPDATE;
34
if (ev->code == ABS_MT_TRACKING_ID) {
36
@@ -580,7 +579,7 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
37
"Attempted to copy values from out-of-range "
38
"slot, touch events may be incorrect.\n");
41
+ else if (hw->slot_state[slot_index] != SLOTSTATE_EMPTY) {
42
hw->slot_state[slot_index] = SLOTSTATE_CLOSE;
43
proto_data->num_touches--;