]> git.eshelyaron.com Git - emacs.git/commit
Fix a bug where the wrong menu would be triggered by mouse
authorJared Finder <jared@finder.org>
Mon, 12 Oct 2020 03:16:00 +0000 (20:16 -0700)
committerEli Zaretskii <eliz@gnu.org>
Sat, 24 Oct 2020 10:26:56 +0000 (13:26 +0300)
commit2c487c47c8c3060818b2fcbfebbcd859f9d06ef5
tree0d72868c70492411ee43d8fc786b9e52192ffc6e
parent92d37029a755e7f610c3bc10c816763c5d853d2f
Fix a bug where the wrong menu would be triggered by mouse

For layouts such as the following, clicking the "l" in Tools with the
right window focused would trigger the File menu, not the Tools menu.
This is because the event would have window coordinate (1 . 0).
Similarly, clicking the "p" in Help would trigger the Edit menu.

Example Emacs frame:
+--------------------------------------------------------+
|File Edit Options Buffers Tools Help                    |
|;; This buffer is for text$|;; This buffer is for text $|
|;; To create a file, visit$|;; To create a file, visit $|
|                           |                            |
|                           |                            |
|-UUU:----F1  *scratch*     |-UUU:----F1  *scratch*      |
|                                                        |
+--------------------------------------------------------+
* lisp/menu-bar.el (menu-bar-open-mouse): Reject clicks not on
the menu bar.
*lisp/xt-mouse.el (xterm-mouse-event): Pass the current frame to
'posn-at-x-y', to make the effect consistent with other mouse-handling
features.
lisp/menu-bar.el
lisp/xt-mouse.el