[PATCH 3/8] evdev-touchpad: Moved has_moved out of hw_abs

Alexander E. Patrakov patrakov at gmail.com
Mon Aug 5 03:34:32 PDT 2013


From: "Alexander E. Patrakov" <patrakov at gmail.com>

For FSM purposes, it is a global property of a touchpad, not a property
of each touch point.
---
 src/evdev-touchpad.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
index 6646896..aafa705 100644
--- a/src/evdev-touchpad.c
+++ b/src/evdev-touchpad.c
@@ -117,11 +117,12 @@ struct touchpad_dispatch {
 		bool x_valid;
 		bool y_valid;
 
-		bool has_moved;
 		bool is_moving;
 		bool is_pressed;
 	} hw_abs;
 
+	bool has_moved;
+
 	int has_pressure;
 	struct {
 		int32_t touch_low;
@@ -484,9 +485,9 @@ touchpad_update_state(struct touchpad_dispatch *touchpad, uint32_t time)
 		}
 	}
 
-	if (!touchpad->hw_abs.has_moved &&
+	if (!touchpad->has_moved &&
 	    ((int)dx || (int)dy)) {
-		touchpad->hw_abs.has_moved = true;
+		touchpad->has_moved = true;
 		push_fsm_event(touchpad, FSM_EVENT_MOTION);
 	}
 
@@ -505,7 +506,7 @@ static void
 on_release(struct touchpad_dispatch *touchpad)
 {
 
-	touchpad->hw_abs.has_moved = touchpad->hw_abs.is_pressed = false;
+	touchpad->has_moved = touchpad->hw_abs.is_pressed = false;
 	touchpad->hw_abs.x_valid = touchpad->hw_abs.y_valid = false;
 	touchpad->hw_abs.is_moving = false;
 
@@ -719,7 +720,7 @@ touchpad_init(struct touchpad_dispatch *touchpad,
 	touchpad->hw_abs.y_valid = false;
 	touchpad->hw_abs.is_pressed = false;
 	touchpad->hw_abs.is_moving = false;
-	touchpad->hw_abs.has_moved = false;
+	touchpad->has_moved = false;
 
 	touchpad->last_finger_state = 0;
 	touchpad->finger_state = 0;
-- 
1.8.3.2



More information about the wayland-devel mailing list