summaryrefslogtreecommitdiff
path: root/lisp/menu-bar.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/menu-bar.el')
-rw-r--r--lisp/menu-bar.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index e42602364d2..f9afc8a5f31 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -2672,6 +2672,12 @@ EVENT should be a mouse down or click event.
Also see `menu-bar-open', which this calls.
This command is to be used when you click the mouse in the menubar."
(interactive "e")
+ ;; This only should be bound to clicks on the menu-bar, outside of
+ ;; any window.
+ (let ((window (posn-window (event-start event))))
+ (when window
+ (error "Event is inside window %s" window)))
+
(let* ((x-position (car (posn-x-y (event-start event))))
(menu-bar-item-cons (menu-bar-item-at-x x-position)))
(menu-bar-open nil