summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Ådahl <jadahl@gmail.com>2013-03-22 08:41:42 +0100
committerKristian Høgsberg <krh@bitplanet.net>2013-03-27 15:39:09 -0400
commit848e2e670ec889e1be07635793f47e15058e20bb (patch)
treeb1811e4e56672bf42210873ce2127517ce0aec76
parent5006596a729524100a345e426bef7b2ed93bc561 (diff)
evdev-touchpad: Disable tap FSM by default on touchpads with button pads
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
-rw-r--r--src/evdev-touchpad.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
index c25a199c..4f9bb033 100644
--- a/src/evdev-touchpad.c
+++ b/src/evdev-touchpad.c
@@ -121,6 +121,8 @@ struct touchpad_dispatch {
int reset;
struct {
+ bool enable;
+
struct wl_array events;
enum fsm_state state;
struct wl_event_source *timer_source;
@@ -300,6 +302,9 @@ process_fsm_events(struct touchpad_dispatch *touchpad, uint32_t time)
enum fsm_event *pevent;
enum fsm_event event;
+ if (!touchpad->fsm.enable)
+ return;
+
if (touchpad->fsm.events.size == 0)
return;
@@ -391,6 +396,9 @@ push_fsm_event(struct touchpad_dispatch *touchpad,
{
enum fsm_event *pevent;
+ if (!touchpad->fsm.enable)
+ return;
+
pevent = wl_array_add(&touchpad->fsm.events, sizeof event);
if (pevent)
*pevent = event;
@@ -661,9 +669,12 @@ touchpad_init(struct touchpad_dispatch *touchpad,
struct weston_motion_filter *accel;
struct wl_event_loop *loop;
+ unsigned long prop_bits[INPUT_PROP_MAX];
struct input_absinfo absinfo;
unsigned long abs_bits[NBITS(ABS_MAX)];
+ bool has_buttonpad;
+
double width;
double height;
double diagonal;
@@ -674,6 +685,9 @@ touchpad_init(struct touchpad_dispatch *touchpad,
/* Detect model */
touchpad->model = get_touchpad_model(device);
+ ioctl(device->fd, EVIOCGPROP(sizeof(prop_bits)), prop_bits);
+ has_buttonpad = TEST_BIT(prop_bits, INPUT_PROP_BUTTONPAD);
+
/* Configure pressure */
ioctl(device->fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits);
if (TEST_BIT(abs_bits, ABS_PRESSURE)) {
@@ -729,6 +743,9 @@ touchpad_init(struct touchpad_dispatch *touchpad,
return -1;
}
+ /* Configure */
+ touchpad->fsm.enable = !has_buttonpad;
+
return 0;
}