Commit 585deda7 authored by Peter Hutterer's avatar Peter Hutterer

gestures: pass the finger count into pinch events

Prep work for multifinger pinch gestures
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <peter.hutterer@who-t.net>
parent c96d11e5
......@@ -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;
......
......@@ -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);
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment