]> git.eshelyaron.com Git - emacs.git/commit
Make TTY menus work with xterm-mouse-mode
authorJared Finder <jared@finder.org>
Sat, 3 Oct 2020 21:46:30 +0000 (14:46 -0700)
committerEli Zaretskii <eliz@gnu.org>
Sat, 24 Oct 2020 10:14:27 +0000 (13:14 +0300)
commit0695c9e8599b5036a80361571e7cb0ea9fdead99
treef6ab30dcdde06d309367f4ae5fbe8688da62dde5
parent9d230684ff16e105db168ebaafdbea2de2e7d6ca
Make TTY menus work with xterm-mouse-mode

* src/term.c (mouse_get_xy): Call 'mouse_position' passing it the
value of 'tty-menu-calls-mouse-position-function' as the
argument.
(syms_of_term) <tty-menu-calls-mouse-position-function>: New
DEFVAR_BOOL.
* src/frame.c (mouse_position): New function, with most of the
code from Fmouse_position, but call 'mouse-position-function' only
if called with non-zero argument.
(Fmouse_position): Call 'mouse_position' to do the job.

* lisp/xt-mouse.el (xterm-mouse-translate-1): Respect
'track-mouse'.
(xterm-mouse-mode): Set 'tty-menu-calls-mouse-position-function'
when setting 'mouse-position-function'.
(xterm-mouse-tracking-enable-sequence): Use SET_ANY_EVENT_MOUSE
(0x1003) so that mouse movement can be reported even if no buttons
are pressed.  Doc fix.
* lisp/menu-bar.el (menu-bar-define-mouse-key): New function.
(tty-menu-navigation-map): Call it.

* doc/lispref/frames.texi (Mouse Position): Document
'tty-menu-calls-mouse-position-function'.

* etc/NEWS: Announce 'tty-menu-calls-mouse-position-function'.
doc/lispref/frames.texi
etc/NEWS
lisp/menu-bar.el
lisp/xt-mouse.el
src/frame.c
src/frame.h
src/term.c