summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorJuri Linkov <juri@linkov.net>2022-02-10 20:57:42 +0200
committerJuri Linkov <juri@linkov.net>2022-02-10 20:57:42 +0200
commit437382734a53e8fb311938d5dd8a39508e60b9bf (patch)
tree4c5d325f6abbbd3cc9ecdf836b1df7f73bf318bc /lisp/mouse.el
parenta6df8f9f990e2553e9b85b273395a4142a427bf8 (diff)
downloademacs-437382734a53e8fb311938d5dd8a39508e60b9bf.tar.gz
emacs-437382734a53e8fb311938d5dd8a39508e60b9bf.tar.bz2
emacs-437382734a53e8fb311938d5dd8a39508e60b9bf.zip
* lisp/mouse.el (context-menu-map): Select only unselected window (bug#53910)
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index acaf6611af5..1e205283de2 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -321,10 +321,12 @@ At the end, it's possible to modify the final menu by specifying
the function `context-menu-filter-function'."
(let* ((menu (make-sparse-keymap (propertize "Context Menu" 'hide t)))
(click (or click last-input-event))
+ (window (posn-window (event-start click)))
(fun (mouse-posn-property (event-start click)
'context-menu-function)))
- (select-window (posn-window (event-start click)))
+ (unless (eq (selected-window) window)
+ (select-window window))
(if (functionp fun)
(setq menu (funcall fun menu click))