diff options
author | Philipp Stephani <phst@google.com> | 2016-11-22 21:32:11 +0100 |
---|---|---|
committer | Philipp Stephani <phst@google.com> | 2016-11-28 19:45:03 +0100 |
commit | 13d468fc0793e23a2f7cd4338b4f5e42e16a96ee (patch) | |
tree | be4dde93eb8377c69ce86bcb4d2444299c05d242 | |
parent | 1228055b320dbed92ab400c4a95813a2b8023909 (diff) | |
download | emacs-13d468fc0793e23a2f7cd4338b4f5e42e16a96ee.tar.gz |
Guard terminal parameter in XTerm mouse mode
It has been observed (in the HTerm terminal emulator) that the
event stored in the 'xterm-mouse-last-down' terminal parameter gets
overwritten during a mouse drag operation, causing Emacs to attempt to
synthesize the non-existing <drag-mouse-0> event. Copy the event into
the terminal parameter to protect against such modifications.
* lisp/xt-mouse.el (xterm-mouse-translate-1): Guard against modification
of input event list.
-rw-r--r-- | lisp/xt-mouse.el | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index 5fb977d99e5..d2d0cf5ee06 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el @@ -70,7 +70,11 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." (cond ((null event) nil) ;Unknown/bogus byte sequence! (is-down - (setf (terminal-parameter nil 'xterm-mouse-last-down) event) + (setf (terminal-parameter nil 'xterm-mouse-last-down) + ;; EVENT might be handed back to the input queue, which + ;; might modify it. Copy it into the terminal parameter + ;; to guard against that. + (copy-sequence event)) vec) (is-move vec) (t |