From: Jonas Ådahl Date: Fri, 22 Mar 2013 07:41:42 +0000 (+0100) Subject: evdev-touchpad: Disable tap FSM by default on touchpads with button pads X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=848e2e670ec889e1be07635793f47e15058e20bb;p=profile%2Fivi%2Fweston-ivi-shell.git evdev-touchpad: Disable tap FSM by default on touchpads with button pads Signed-off-by: Jonas Ådahl --- diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c index c25a199..4f9bb03 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; }