|
|
|
@ -260,3 +260,41 @@ void handle_pointer_pinch_end(struct libinput_event *event,
|
|
|
|
|
};
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.pinch_end, &wlr_event);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void handle_pointer_hold_begin(struct libinput_event *event,
|
|
|
|
|
struct libinput_device *libinput_dev) {
|
|
|
|
|
struct wlr_input_device *wlr_dev =
|
|
|
|
|
get_appropriate_device(WLR_INPUT_DEVICE_POINTER, libinput_dev);
|
|
|
|
|
if (!wlr_dev) {
|
|
|
|
|
wlr_log(WLR_DEBUG, "Got a pointer gesture event for a device with no pointers?");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
struct libinput_event_gesture *gevent =
|
|
|
|
|
libinput_event_get_gesture_event(event);
|
|
|
|
|
struct wlr_event_pointer_hold_begin wlr_event = {
|
|
|
|
|
.device = wlr_dev,
|
|
|
|
|
.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
|
|
|
|
.fingers = libinput_event_gesture_get_finger_count(gevent),
|
|
|
|
|
};
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.hold_begin, &wlr_event);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void handle_pointer_hold_end(struct libinput_event *event,
|
|
|
|
|
struct libinput_device *libinput_dev) {
|
|
|
|
|
struct wlr_input_device *wlr_dev =
|
|
|
|
|
get_appropriate_device(WLR_INPUT_DEVICE_POINTER, libinput_dev);
|
|
|
|
|
if (!wlr_dev) {
|
|
|
|
|
wlr_log(WLR_DEBUG, "Got a pointer gesture event for a device with no pointers?");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
struct libinput_event_gesture *gevent =
|
|
|
|
|
libinput_event_get_gesture_event(event);
|
|
|
|
|
struct wlr_event_pointer_hold_end wlr_event = {
|
|
|
|
|
.device = wlr_dev,
|
|
|
|
|
.time_msec =
|
|
|
|
|
usec_to_msec(libinput_event_gesture_get_time_usec(gevent)),
|
|
|
|
|
.cancelled = libinput_event_gesture_get_cancelled(gevent),
|
|
|
|
|
};
|
|
|
|
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.hold_end, &wlr_event);
|
|
|
|
|
}
|
|
|
|
|