[PATCH libinput 17/19] touchpad: mark the first finger as pointer-controlling finger

Peter Hutterer peter.hutterer at who-t.net
Sun Feb 16 22:48:36 PST 2014


Unused at the moment, but will be used later to determine if a finger should
trigger motion events.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev-mt-touchpad.c | 4 ++++
 src/evdev-mt-touchpad.h | 1 +
 2 files changed, 5 insertions(+)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 154df85..84764ac 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -159,6 +159,9 @@ tp_begin_touch(struct tp_dispatch *tp, struct tp_touch *t)
 		tp->nfingers_down++;
 		assert(tp->nfingers_down >= 1);
 		tp->queued |= TOUCHPAD_EVENT_MOTION;
+
+		if (tp->nfingers_down == 1)
+			t->is_pointer = true;
 	}
 }
 
@@ -169,6 +172,7 @@ tp_end_touch(struct tp_dispatch *tp, struct tp_touch *t)
 		return;
 
 	t->dirty = true;
+	t->is_pointer = false;
 	t->state = TOUCH_END;
 	assert(tp->nfingers_down >= 1);
 	tp->nfingers_down--;
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index 327ce11..df83b2c 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -76,6 +76,7 @@ struct tp_touch {
 	enum touch_state state;
 	bool dirty;
 	bool fake;				/* a fake touch */
+	bool is_pointer;			/* the pointer-controlling touch */
 	int32_t x;
 	int32_t y;
 	uint32_t millis;
-- 
1.8.4.2



More information about the wayland-devel mailing list