|
|
@ -121,6 +121,8 @@ struct touchpad_dispatch { |
|
|
|
int reset; |
|
|
|
int reset; |
|
|
|
|
|
|
|
|
|
|
|
struct { |
|
|
|
struct { |
|
|
|
|
|
|
|
bool enable; |
|
|
|
|
|
|
|
|
|
|
|
struct wl_array events; |
|
|
|
struct wl_array events; |
|
|
|
enum fsm_state state; |
|
|
|
enum fsm_state state; |
|
|
|
struct wl_event_source *timer_source; |
|
|
|
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 *pevent; |
|
|
|
enum fsm_event event; |
|
|
|
enum fsm_event event; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!touchpad->fsm.enable) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
if (touchpad->fsm.events.size == 0) |
|
|
|
if (touchpad->fsm.events.size == 0) |
|
|
|
return; |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
@ -391,6 +396,9 @@ push_fsm_event(struct touchpad_dispatch *touchpad, |
|
|
|
{ |
|
|
|
{ |
|
|
|
enum fsm_event *pevent; |
|
|
|
enum fsm_event *pevent; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!touchpad->fsm.enable) |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
|
pevent = wl_array_add(&touchpad->fsm.events, sizeof event); |
|
|
|
pevent = wl_array_add(&touchpad->fsm.events, sizeof event); |
|
|
|
if (pevent) |
|
|
|
if (pevent) |
|
|
|
*pevent = event; |
|
|
|
*pevent = event; |
|
|
@ -661,9 +669,12 @@ touchpad_init(struct touchpad_dispatch *touchpad, |
|
|
|
struct weston_motion_filter *accel; |
|
|
|
struct weston_motion_filter *accel; |
|
|
|
struct wl_event_loop *loop; |
|
|
|
struct wl_event_loop *loop; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned long prop_bits[INPUT_PROP_MAX]; |
|
|
|
struct input_absinfo absinfo; |
|
|
|
struct input_absinfo absinfo; |
|
|
|
unsigned long abs_bits[NBITS(ABS_MAX)]; |
|
|
|
unsigned long abs_bits[NBITS(ABS_MAX)]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool has_buttonpad; |
|
|
|
|
|
|
|
|
|
|
|
double width; |
|
|
|
double width; |
|
|
|
double height; |
|
|
|
double height; |
|
|
|
double diagonal; |
|
|
|
double diagonal; |
|
|
@ -674,6 +685,9 @@ touchpad_init(struct touchpad_dispatch *touchpad, |
|
|
|
/* Detect model */ |
|
|
|
/* Detect model */ |
|
|
|
touchpad->model = get_touchpad_model(device); |
|
|
|
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 */ |
|
|
|
/* Configure pressure */ |
|
|
|
ioctl(device->fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits); |
|
|
|
ioctl(device->fd, EVIOCGBIT(EV_ABS, sizeof(abs_bits)), abs_bits); |
|
|
|
if (TEST_BIT(abs_bits, ABS_PRESSURE)) { |
|
|
|
if (TEST_BIT(abs_bits, ABS_PRESSURE)) { |
|
|
@ -729,6 +743,9 @@ touchpad_init(struct touchpad_dispatch *touchpad, |
|
|
|
return -1; |
|
|
|
return -1; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Configure */ |
|
|
|
|
|
|
|
touchpad->fsm.enable = !has_buttonpad; |
|
|
|
|
|
|
|
|
|
|
|
return 0; |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|