summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/evdev-mt-touchpad-gestures.c5
-rw-r--r--src/evdev-mt-touchpad.c3
-rw-r--r--src/evdev-mt-touchpad.h1
3 files changed, 7 insertions, 2 deletions
diff --git a/src/evdev-mt-touchpad-gestures.c b/src/evdev-mt-touchpad-gestures.c
index 3b1839e..da03c26 100644
--- a/src/evdev-mt-touchpad-gestures.c
+++ b/src/evdev-mt-touchpad-gestures.c
@@ -295,7 +295,7 @@ tp_gesture_twofinger_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
((dir2 & 0x80) && (dir1 & 0x01))) {
tp_gesture_set_scroll_buildup(tp);
return GESTURE_2FG_STATE_SCROLL;
- } else {
+ } else if (tp->gesture.enabled) {
tp_gesture_get_pinch_info(tp,
&tp->gesture.initial_distance,
&tp->gesture.angle,
@@ -303,6 +303,8 @@ tp_gesture_twofinger_handle_state_unknown(struct tp_dispatch *tp, uint64_t time)
tp->gesture.prev_scale = 1.0;
return GESTURE_2FG_STATE_PINCH;
}
+
+ return GESTURE_2FG_STATE_UNKNOWN;
}
static enum tp_gesture_2fg_state
@@ -563,6 +565,7 @@ tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time)
int
tp_init_gesture(struct tp_dispatch *tp)
{
+ tp->gesture.enabled = true;
tp->gesture.twofinger_state = GESTURE_2FG_STATE_NONE;
libinput_timer_init(&tp->gesture.finger_count_switch_timer,
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index e110b9a..af1cd47 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -1918,7 +1918,8 @@ tp_init(struct tp_dispatch *tp,
return -1;
device->seat_caps |= EVDEV_DEVICE_POINTER;
- device->seat_caps |= EVDEV_DEVICE_GESTURE;
+ if (tp->gesture.enabled)
+ device->seat_caps |= EVDEV_DEVICE_GESTURE;
return 0;
}
diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h
index a7961e7..3bd8425 100644
--- a/src/evdev-mt-touchpad.h
+++ b/src/evdev-mt-touchpad.h
@@ -246,6 +246,7 @@ struct tp_dispatch {
} accel;
struct {
+ bool enabled;
bool started;
unsigned int finger_count;
unsigned int finger_count_pending;