summaryrefslogtreecommitdiff
path: root/src/multitouch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/multitouch.c')
-rw-r--r--src/multitouch.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/multitouch.c b/src/multitouch.c
index 987cf34..a16d1b1 100644
--- a/src/multitouch.c
+++ b/src/multitouch.c
@@ -128,7 +128,7 @@ static void handle_state(LocalDevicePtr local,
128 const struct State *ns) 128 const struct State *ns)
129{ 129{
130 const struct FingerState *fs, *p, *e = ns->finger + ns->nfinger; 130 const struct FingerState *fs, *p, *e = ns->finger + ns->nfinger;
131 int dx = 0, dy = 0, i; 131 int dx = 0, dy = 0, n = 0, i;
132 for (p = ns->finger; p != e; p++) { 132 for (p = ns->finger; p != e; p++) {
133 if (fs = find_finger(os, p->id)) { 133 if (fs = find_finger(os, p->id)) {
134 dx += p->hw.position_x - fs->hw.position_x; 134 dx += p->hw.position_x - fs->hw.position_x;
@@ -136,15 +136,23 @@ static void handle_state(LocalDevicePtr local,
136 } 136 }
137 } 137 }
138 if (dx || dy) { 138 if (dx || dy) {
139 output_state(ns);
140 xf86Msg(X_INFO, "motion: %d %d\n", dx, dy);
141 xf86PostMotionEvent(local->dev, 0, 0, 2, dx, dy); 139 xf86PostMotionEvent(local->dev, 0, 0, 2, dx, dy);
140 xf86Msg(X_INFO, "motion: %d %d\n", dx, dy);
141 n++;
142 } 142 }
143 for (i = 0; i < DIM_BUTTON; i++) 143 for (i = 0; i < DIM_BUTTON; i++) {
144 if (ns->button[i] != os->button[i]) 144 if (GETBIT(ns->button, i) != GETBIT(os->button, i)) {
145 xf86PostButtonEvent(local->dev, FALSE, 145 xf86PostButtonEvent(local->dev, FALSE,
146 i + 1, ns->button[i], 146 i, GETBIT(ns->button, i),
147 0, 0); 147 0, 0);
148 xf86Msg(X_INFO, "button: %d -> %d\n",
149 i, GETBIT(ns->button, i));
150 n++;
151 }
152 }
153 if (n) {
154 output_state(ns);
155 }
148} 156}
149 157
150//////////////////////////////////////////////////////////////////////////// 158////////////////////////////////////////////////////////////////////////////