evdev-touchpad: Disable tap FSM by default on touchpads with button pads
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
parent
5006596a72
commit
848e2e670e
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user