From 65f49ab69fc2c0ecbea31288be5ec34f8b188f0b Mon Sep 17 00:00:00 2001 From: w00893971 Date: Thu, 19 Dec 2024 16:04:14 +0800 Subject: [PATCH] [feature]: Keep touchpad multi-finger state when finger count change (>1) util finger count <=1 Signed-off-by: w00893971 --- patch/diff_libinput_mmi/libinput/libinput_0000.diff | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/patch/diff_libinput_mmi/libinput/libinput_0000.diff b/patch/diff_libinput_mmi/libinput/libinput_0000.diff index 241bcf2..c4bb127 100644 --- a/patch/diff_libinput_mmi/libinput/libinput_0000.diff +++ b/patch/diff_libinput_mmi/libinput/libinput_0000.diff @@ -3507,7 +3507,7 @@ diff -Naur old/src/evdev-mt-touchpad-gestures.c new/src/evdev-mt-touchpad-gestur } if (active_touches != tp->gesture.finger_count) { -@@ -1438,6 +2123,10 @@ +@@ -1438,6 +2123,14 @@ tp_gesture_stop(tp, time); tp->gesture.finger_count = 0; tp->gesture.finger_count_pending = 0; @@ -3515,10 +3515,14 @@ diff -Naur old/src/evdev-mt-touchpad-gestures.c new/src/evdev-mt-touchpad-gestur + time - time_start < TIME_GESTURE_WAIT_ALL_FINGER_DOWN) { + tp_gesture_cancel(tp, time); + tp->gesture.finger_count = active_touches; ++ /* Do not change touchpad multi-finger gesture when finger count change(>1) util finger count <=1 */ ++ } else if (tp->gesture.started && tp->gesture.finger_count > 2 && active_touches >1 && ++ (tp->gesture.state == GESTURE_STATE_SWIPE || tp->gesture.state == GESTURE_STATE_PINCH)) { ++ return; /* Immediately switch to new mode to avoid initial latency */ } else if (!tp->gesture.started) { tp->gesture.finger_count = active_touches; -@@ -1504,6 +2193,41 @@ +@@ -1504,6 +2197,41 @@ LIBINPUT_CONFIG_HOLD_DISABLED; } -- Gitee