aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPo Lu2024-06-08 14:25:22 +0800
committerPo Lu2024-06-08 15:18:27 +0800
commit4fa38af7c2dc1070e67530871a013abfaeee48c7 (patch)
treed9abe80284106ceccfdd9d863533ef2bada70b19
parentbef514de4d3c88f60ad23115ec10f0ec064e9ae7 (diff)
downloademacs-4fa38af7c2dc1070e67530871a013abfaeee48c7.tar.gz
emacs-4fa38af7c2dc1070e67530871a013abfaeee48c7.zip
Remove touchscreen pinch event generation threshold
* lisp/touch-screen.el (touch-screen-handle-aux-point-update): Remove the said threshold.
-rw-r--r--lisp/touch-screen.el69
1 files changed, 28 insertions, 41 deletions
diff --git a/lisp/touch-screen.el b/lisp/touch-screen.el
index 828810e7b33..dd6bbf8ccce 100644
--- a/lisp/touch-screen.el
+++ b/lisp/touch-screen.el
@@ -1211,48 +1211,35 @@ last such event."
1211 (initial-distance (aref touch-screen-aux-tool 4)) 1211 (initial-distance (aref touch-screen-aux-tool 4))
1212 (initial-centrum (aref touch-screen-aux-tool 5))) 1212 (initial-centrum (aref touch-screen-aux-tool 5)))
1213 (let* ((ratio (/ distance initial-distance)) 1213 (let* ((ratio (/ distance initial-distance))
1214 (ratio-diff (- ratio (aref touch-screen-aux-tool 6))) 1214 (ratio-diff (- ratio (aref touch-screen-aux-tool 6))))
1215 (diff (abs (- ratio (aref touch-screen-aux-tool 6)))) 1215 ;; Update the internal record of its position and generate an
1216 (centrum-diff (+ (abs (- (car initial-centrum) 1216 ;; event.
1217 (car centrum))) 1217 (aset touch-screen-aux-tool 5 centrum)
1218 (abs (- (cdr initial-centrum) 1218 (aset touch-screen-aux-tool 6 ratio)
1219 (cdr centrum)))))) 1219 (throw 'input-event
1220 ;; If the difference in ratio has surpassed a threshold of 1220 (list 'touchscreen-pinch
1221 ;; 0.2 or the centrum difference exceeds the frame's char 1221 (if (or (<= (car centrum) 0)
1222 ;; width, send a touchscreen-pinch event with this 1222 (<= (cdr centrum) 0))
1223 ;; information and update that saved in 1223 (list window nil centrum nil nil
1224 ;; touch-screen-aux-tool. 1224 nil nil nil nil nil)
1225 (when (or (> diff 0.2) 1225 (let ((posn (posn-at-x-y (car centrum)
1226 (> centrum-diff 1226 (cdr centrum)
1227 (/ (frame-char-width) 2))) 1227 window)))
1228 (aset touch-screen-aux-tool 5 centrum) 1228 (if (eq (posn-window posn)
1229 (aset touch-screen-aux-tool 6 ratio) 1229 window)
1230 (throw 'input-event 1230 posn
1231 (list 'touchscreen-pinch 1231 ;; Return a placeholder outside the window
1232 (if (or (<= (car centrum) 0) 1232 ;; if the centrum has moved beyond the
1233 (<= (cdr centrum) 0)) 1233 ;; confines of the window where the gesture
1234 ;; commenced.
1234 (list window nil centrum nil nil 1235 (list window nil centrum nil nil
1235 nil nil nil nil nil) 1236 nil nil nil nil nil))))
1236 (let ((posn (posn-at-x-y (car centrum) 1237 ratio
1237 (cdr centrum) 1238 (- (car centrum)
1238 window))) 1239 (car initial-centrum))
1239 (if (eq (posn-window posn) 1240 (- (cdr centrum)
1240 window) 1241 (cdr initial-centrum))
1241 posn 1242 ratio-diff)))))))
1242 ;; Return a placeholder
1243 ;; outside the window if
1244 ;; the centrum has moved
1245 ;; beyond the confines of
1246 ;; the window where the
1247 ;; gesture commenced.
1248 (list window nil centrum nil nil
1249 nil nil nil nil nil))))
1250 ratio
1251 (- (car centrum)
1252 (car initial-centrum))
1253 (- (cdr centrum)
1254 (cdr initial-centrum))
1255 ratio-diff))))))))
1256 1243
1257(defun touch-screen-window-selection-changed (frame) 1244(defun touch-screen-window-selection-changed (frame)
1258 "Notice that FRAME's selected window has changed. 1245 "Notice that FRAME's selected window has changed.