summaryrefslogtreecommitdiff
path: root/src/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/memory.c')
-rw-r--r--src/memory.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/memory.c b/src/memory.c
index 9084502..39621da 100644
--- a/src/memory.c
+++ b/src/memory.c
@@ -21,6 +21,9 @@
21 21
22#include "memory.h" 22#include "memory.h"
23 23
24/* click area definition */
25#define CLICK_AREA(c) ((c->has_ibt ? 0.20 : 0.00) * get_cap_ysize(c))
26
24/* fraction of max movement threshold */ 27/* fraction of max movement threshold */
25#define DELTA_CUT(x) (0.5 * (x)) 28#define DELTA_CUT(x) (0.5 * (x))
26 29
@@ -88,11 +91,12 @@ static void update_pointers(struct Memory *m,
88 const struct Capabilities *caps) 91 const struct Capabilities *caps)
89{ 92{
90 const struct MTFinger *f = state->finger; 93 const struct MTFinger *f = state->finger;
94 int yclick = caps->abs[BIT_POSITION_Y].maximum - CLICK_AREA(caps);
91 int i; 95 int i;
92 96
93 if (state->nfinger < 2) { 97 if (state->nfinger < 2) {
94 m->pointing = m->fingers; 98 m->pointing = m->fingers;
95 m->ybar = caps->abs_position_y.maximum; 99 m->ybar = caps->abs[BIT_POSITION_Y].maximum;
96 return; 100 return;
97 } 101 }
98 102
@@ -107,9 +111,9 @@ static void update_pointers(struct Memory *m,
107 } 111 }
108 112
109 m->pointing = 0; 113 m->pointing = 0;
110 m->ybar = caps->yclick; 114 m->ybar = yclick;
111 foreach_bit(i, m->fingers) { 115 foreach_bit(i, m->fingers) {
112 if (f[i].hw.position_y > caps->yclick) 116 if (f[i].hw.position_y > yclick)
113 continue; 117 continue;
114 if (!m->pointing || f[i].hw.position_y > m->ybar) 118 if (!m->pointing || f[i].hw.position_y > m->ybar)
115 m->ybar = f[i].hw.position_y; 119 m->ybar = f[i].hw.position_y;