~jderose/ubuntu/raring/xserver-xorg-input-synaptics/clickpad

« back to all changes in this revision

Viewing changes to debian/patches/202-Ignore-pre-existing-touches.patch

  • Committer: Package Import Robot
  • Author(s): Maarten Lankhorst
  • Date: 2012-05-21 14:14:49 UTC
  • mfrom: (0.3.14 sid)
  • Revision ID: package-import@ubuntu.com-20120521141449-xj02s01b4b9yx2f1
Tags: 1.6.1-1ubuntu1
* Merged from Debian unstable
* Refreshed patches for indentation changes
  - 101_resolution_detect_option.patch
  - 118_quell_error_msg.patch
  - 124_syndaemon_events.patch
  - 125_option_rec_revert.patch
* Add temporary patches, for upstream git commits on synaptics-1.6-branch
* Fix memory corruption by driver (LP: #941953) FDo #49439
 - 201-Avoid-out-of-bounds-access-by-running-num_active_tou.patch
 - 202-Ignore-pre-existing-touches.patch
* Fix FDo #49966
 - 203-Fix-coasting-for-negative-ScrollDelta.patch
* Fix jumpy cursor after suspend/resume
 - 204-Reset-open-slots-array-on-device-disable.patch
* Fix another resume bug
 - 205-Reset-hw-x-y-to-INT_MIN-and-skip-HandleState-until-w.patch
* Fix division by 0 or infinite loop with zero scroll distance FDo #49965
 - 206-Don-t-allow-for-scroll-distances-of-0-49965.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
5
 
 
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.
 
10
 
 
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.
 
14
 
 
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)
 
18
---
 
19
 src/eventcomm.c |    5 ++---
 
20
 1 file changed, 2 insertions(+), 3 deletions(-)
 
21
 
 
22
diff --git a/src/eventcomm.c b/src/eventcomm.c
 
23
index 89a8a3a..280ef9b 100644
 
24
--- a/src/eventcomm.c
 
25
+++ b/src/eventcomm.c
 
26
@@ -564,8 +564,7 @@ EventProcessTouchEvent(InputInfoPtr pInfo, struct SynapticsHwState *hw,
 
27
         if (slot_index < 0)
 
28
             return;
 
29
 
 
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) {
 
35
             if (ev->value >= 0) {
 
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");
 
39
             }
 
40
-            else {
 
41
+            else if (hw->slot_state[slot_index] != SLOTSTATE_EMPTY) {
 
42
                 hw->slot_state[slot_index] = SLOTSTATE_CLOSE;
 
43
                 proto_data->num_touches--;
 
44
             }
 
45
-- 
 
46
1.7.9.5
 
47