#define DEFAULT_GESTURE_SWITCH_TIMEOUT 100 /* ms */
#define DEFAULT_GESTURE_2FG_SCROLL_TIMEOUT 1000 /* ms */
+#define CASE_RETURN_STRING(a) case a: return #a
+
+static inline const char*
+gesture_state_to_str(enum tp_gesture_2fg_state state)
+{
+ switch (state) {
+ CASE_RETURN_STRING(GESTURE_2FG_STATE_NONE);
+ CASE_RETURN_STRING(GESTURE_2FG_STATE_UNKNOWN);
+ CASE_RETURN_STRING(GESTURE_2FG_STATE_SCROLL);
+ CASE_RETURN_STRING(GESTURE_2FG_STATE_PINCH);
+ }
+ return NULL;
+}
+
static struct normalized_coords
tp_get_touches_delta(struct tp_dispatch *tp, bool average)
{
static void
tp_gesture_post_twofinger(struct tp_dispatch *tp, uint64_t time)
{
+ enum tp_gesture_2fg_state oldstate = tp->gesture.twofinger_state;
+
if (tp->gesture.twofinger_state == GESTURE_2FG_STATE_NONE)
tp->gesture.twofinger_state =
tp_gesture_twofinger_handle_state_none(tp, time);
if (tp->gesture.twofinger_state == GESTURE_2FG_STATE_PINCH)
tp->gesture.twofinger_state =
tp_gesture_twofinger_handle_state_pinch(tp, time);
+
+ log_debug(tp_libinput_context(tp),
+ "gesture state: %s → %s\n",
+ gesture_state_to_str(oldstate),
+ gesture_state_to_str(tp->gesture.twofinger_state));
}
static void