diff options
| author | Henrik Rydberg <rydberg@euromail.se> | 2008-11-08 16:01:51 +0100 |
|---|---|---|
| committer | Henrik Rydberg <rydberg@euromail.se> | 2008-11-08 16:01:51 +0100 |
| commit | 809b43cb3bac52ad87228a458dcd3dbf11180c97 (patch) | |
| tree | ffc51f2d9fa6a76e85170bb0ac1279931e722a4c /src/multitouch.c | |
| parent | 9f6a75a35de8d05a8ae2e8b5d5cd10d960d4de4b (diff) | |
cleanup
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'src/multitouch.c')
| -rw-r--r-- | src/multitouch.c | 20 |
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 | //////////////////////////////////////////////////////////////////////////// |
