gestures: pass the finger count into pinch events

Prep work for multifinger pinch gestures

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2016-01-07 13:57:03 +10:00
parent c96d11e531
commit 585deda799
3 changed files with 10 additions and 3 deletions

View file

@ -109,6 +109,7 @@ tp_gesture_start(struct tp_dispatch *tp, uint64_t time)
case GESTURE_STATE_PINCH:
gesture_notify_pinch(&tp->device->base, time,
LIBINPUT_EVENT_GESTURE_PINCH_BEGIN,
tp->gesture.finger_count,
&zero, &zero, 1.0, 0.0);
break;
}
@ -378,6 +379,7 @@ tp_gesture_twofinger_handle_state_pinch(struct tp_dispatch *tp, uint64_t time)
tp_gesture_start(tp, time);
gesture_notify_pinch(&tp->device->base, time,
LIBINPUT_EVENT_GESTURE_PINCH_UPDATE,
tp->gesture.finger_count,
&delta, &unaccel, scale, angle_delta);
tp->gesture.prev_scale = scale;
@ -496,6 +498,7 @@ tp_gesture_end(struct tp_dispatch *tp, uint64_t time, bool cancelled)
break;
case GESTURE_STATE_PINCH:
gesture_notify_pinch_end(&tp->device->base, time,
tp->gesture.finger_count,
tp->gesture.prev_scale,
cancelled);
break;

View file

@ -429,6 +429,7 @@ void
gesture_notify_pinch(struct libinput_device *device,
uint64_t time,
enum libinput_event_type type,
int finger_count,
const struct normalized_coords *delta,
const struct normalized_coords *unaccel,
double scale,
@ -437,6 +438,7 @@ gesture_notify_pinch(struct libinput_device *device,
void
gesture_notify_pinch_end(struct libinput_device *device,
uint64_t time,
int finger_count,
double scale,
int cancelled);

View file

@ -1673,25 +1673,27 @@ void
gesture_notify_pinch(struct libinput_device *device,
uint64_t time,
enum libinput_event_type type,
int finger_count,
const struct normalized_coords *delta,
const struct normalized_coords *unaccel,
double scale,
double angle)
{
gesture_notify(device, time, type, 2, 0, delta, unaccel,
scale, angle);
gesture_notify(device, time, type, finger_count, 0,
delta, unaccel, scale, angle);
}
void
gesture_notify_pinch_end(struct libinput_device *device,
uint64_t time,
int finger_count,
double scale,
int cancelled)
{
const struct normalized_coords zero = { 0.0, 0.0 };
gesture_notify(device, time, LIBINPUT_EVENT_GESTURE_PINCH_END,
2, cancelled, &zero, &zero, scale, 0.0);
finger_count, cancelled, &zero, &zero, scale, 0.0);
}
static void