summaryrefslogtreecommitdiff
path: root/lisp/xt-mouse.el
diff options
context:
space:
mode:
authorJared Finder <jared@finder.org>2020-10-31 21:25:47 -0800
committerEli Zaretskii <eliz@gnu.org>2020-11-14 14:31:55 +0200
commit91d5edd9d10db30418cb32f5734d496d76ef56f3 (patch)
tree3f21bae82386a7b9f976d483ef3b68cf387a9f0f /lisp/xt-mouse.el
parent31f94e4b1c3dc201646ec436d3e2c477f784ed21 (diff)
downloademacs-91d5edd9d10db30418cb32f5734d496d76ef56f3.tar.gz
Face-changing text properties and help-echo now work with xterm-mouse.
* src/dispnew.c (update_mouse_position): New function for mouse movement logic in 'handle_one_term_event' that can be shared across different mouse backends. (display--update-for-mouse-movement): New lisp function, call it. * lisp/xt-mouse.el (xterm-mouse--handle-mouse-movement): New function that calls 'display--update-for-mouse-movement'. (xterm-mouse-translate-1): Call it. * src/term.c (handle_one_term_event): Inline logic from 'term_mouse_movement' and call 'update_mouse_position'. (term_mouse_movement): Delete.
Diffstat (limited to 'lisp/xt-mouse.el')
-rw-r--r--lisp/xt-mouse.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index f9c08f9a174..9301476e815 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -77,6 +77,7 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
(copy-sequence event))
vec)
(is-move
+ (xterm-mouse--handle-mouse-movement)
(if track-mouse vec
;; Mouse movement events are currently supposed to be
;; suppressed. Return no event.
@@ -106,8 +107,14 @@ https://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
(if (null track-mouse)
(vector drag)
(push drag unread-command-events)
+ (xterm-mouse--handle-mouse-movement)
(vector (list 'mouse-movement ev-data))))))))))))
+(defun xterm-mouse--handle-mouse-movement ()
+ "Handle mouse motion that was just generated for XTerm mouse."
+ (display--update-for-mouse-movement (terminal-parameter nil 'xterm-mouse-x)
+ (terminal-parameter nil 'xterm-mouse-y)))
+
;; These two variables have been converted to terminal parameters.
;;
;;(defvar xterm-mouse-x 0