diff options
author | Juri Linkov <juri@linkov.net> | 2022-02-10 20:57:42 +0200 |
---|---|---|
committer | Juri Linkov <juri@linkov.net> | 2022-02-10 20:57:42 +0200 |
commit | 437382734a53e8fb311938d5dd8a39508e60b9bf (patch) | |
tree | 4c5d325f6abbbd3cc9ecdf836b1df7f73bf318bc /lisp/mouse.el | |
parent | a6df8f9f990e2553e9b85b273395a4142a427bf8 (diff) | |
download | emacs-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.el | 4 |
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)) |