GNU bug report logs - #53249
Context menu in other window

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 14 Jan 2022 08:54:01 UTC

Severity: normal

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juri Linkov <juri <at> linkov.net>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#53249: closed (Context menu in other window)
Date: Sat, 15 Jan 2022 18:42:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Sat, 15 Jan 2022 20:38:11 +0200
with message-id <86k0f03kvg.fsf <at> mail.linkov.net>
and subject line Re: bug#53249: Context menu in other window
has caused the debbugs.gnu.org bug report #53249,
regarding Context menu in other window
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
53249: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=53249
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Context menu in other window
Date: Fri, 14 Jan 2022 10:42:43 +0200
When clicking the right mouse button in another window,
some context-menu functions break the window configuration.
For example, when two windows show different parts of the same buffer,
this code in `prog-context-menu':

  (let ((identifier (save-excursion
                      (mouse-set-point click)
                      (xref-backend-identifier-at-point
                       (xref-find-backend)))))

moves window point of another window to the same position of the
selected window.

So the safest thing to do here is to select the window where
the context menu is invoked:

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 0d8d7d6175..45b7d51da7 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -320,6 +320,8 @@ context-menu-map
          (fun (mouse-posn-property (event-start click)
                                    'context-menu-function)))
 
+    (select-window (posn-window (event-start click)))
+
     (if (functionp fun)
         (setq menu (funcall fun menu click))
       (run-hook-wrapped 'context-menu-functions
-- 


[Message part 3 (message/rfc822, inline)]
From: Juri Linkov <juri <at> linkov.net>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 53249-done <at> debbugs.gnu.org
Subject: Re: bug#53249: Context menu in other window
Date: Sat, 15 Jan 2022 20:38:11 +0200
>> So the safest thing to do here is to select the window where
>> the context menu is invoked:
>
> Makes sense to me.

So pushed to master and closed.


This bug report was last modified 3 years and 162 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.