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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53249 in the body.
You can then email your comments to 53249 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#53249; Package emacs. (Fri, 14 Jan 2022 08:54:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 14 Jan 2022 08:54:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

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
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#53249; Package emacs. (Fri, 14 Jan 2022 09:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 53249 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 53249 <at> debbugs.gnu.org
Subject: Re: bug#53249: Context menu in other window
Date: Fri, 14 Jan 2022 10:00:26 +0100
Juri Linkov <juri <at> linkov.net> writes:

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

Makes sense to me.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Sat, 15 Jan 2022 18:42:01 GMT) Full text and rfc822 format available.

Notification sent to Juri Linkov <juri <at> linkov.net>:
bug acknowledged by developer. (Sat, 15 Jan 2022 18:42:02 GMT) Full text and rfc822 format available.

Message #13 received at 53249-done <at> debbugs.gnu.org (full text, mbox):

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.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 Feb 2022 12:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 65 days ago.

Previous Next


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