summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2011-06-09 20:02:49 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2011-08-25 09:50:33 +1000
commit6d1f8f9886cbd4b3073502f3f37c4dd618971361 (patch)
tree8dc6387634b690b64d3f9a393ab11f518112167c
parent0f171af28410f939a915064af9fb9af38118455d (diff)
Give FingerState enums explicit values
Since we depend so heavily on ordering and numbering, just give all the enum explicit number values. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics.c2
-rw-r--r--src/synapticsstr.h8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 9b3f190..8ab2903 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -2527,7 +2527,7 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
}
/* Post events */
- if (finger > FS_UNTOUCHED) {
+ if (finger >= FS_TOUCHED) {
if (priv->absolute_events && inside_active_area) {
xf86PostMotionEvent(pInfo->dev, 1, 0, 2, hw->x, hw->y);
} else if (dx || dy) {
diff --git a/src/synapticsstr.h b/src/synapticsstr.h
index b2fecbe..c69ba09 100644
--- a/src/synapticsstr.h
+++ b/src/synapticsstr.h
@@ -51,10 +51,10 @@ typedef struct _SynapticsMoveHist
int millis;
} SynapticsMoveHistRec;
-enum FingerState { /* Note! The order matters. Compared with < operator. */
- FS_UNTOUCHED,
- FS_TOUCHED,
- FS_PRESSED
+enum FingerState { /* Note! The order matters. Compared with < operator. */
+ FS_UNTOUCHED = 0, /* this is 0 so it's the initialized value. */
+ FS_TOUCHED = 1,
+ FS_PRESSED = 2,
};
enum MovingState {