emacs-diffs
[Top][All Lists]
Advanced

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

master cd6ce7e546: Make <mouse-3> in the mode line more careful


From: Lars Ingebrigtsen
Subject: master cd6ce7e546: Make <mouse-3> in the mode line more careful
Date: Sun, 26 Jun 2022 11:30:18 -0400 (EDT)

branch: master
commit cd6ce7e546e6d2ed1918a1d20341c1e4c9050a9a
Author: Visuwesh <visuweshm@gmail.com>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Make <mouse-3> in the mode line more careful
    
    * lisp/mouse.el (mouse-delete-window): Only delete the window if
    the user hasn't moved point out of the mode line before releasing
    the button (bug#56198).
---
 lisp/mouse.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/mouse.el b/lisp/mouse.el
index 82c8a14693..3b33ba817b 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -655,7 +655,13 @@ This command must be bound to a mouse click."
   (interactive "e")
   (unless (one-window-p t)
     (mouse-minibuffer-check click)
-    (delete-window (posn-window (event-start click)))))
+    ;; Only delete the window if the user hasn't moved point out of
+    ;; the mode line before releasing the button.
+    (when (and (eq (posn-area (event-end click))
+                   'mode-line)
+               (eq (posn-window (event-end click))
+                   (posn-window (event-start click))))
+      (delete-window (posn-window (event-start click))))))
 
 (defun mouse-select-window (click)
   "Select the window clicked on; don't move point."



reply via email to

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