emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 437382734a 2/2: * lisp/mouse.el (context-menu-map): Select only u


From: Juri Linkov
Subject: master 437382734a 2/2: * lisp/mouse.el (context-menu-map): Select only unselected window (bug#53910)
Date: Thu, 10 Feb 2022 13:58:14 -0500 (EST)

branch: master
commit 437382734a53e8fb311938d5dd8a39508e60b9bf
Author: Juri Linkov <juri@linkov.net>
Commit: Juri Linkov <juri@linkov.net>

    * lisp/mouse.el (context-menu-map): Select only unselected window 
(bug#53910)
---
 lisp/mouse.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index acaf6611af..1e205283de 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]