1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-05-04 12:21:46 -07:00

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).
This commit is contained in:
Visuwesh 2022-06-26 17:30:04 +02:00 committed by Lars Ingebrigtsen
parent 7fc3f1b0d1
commit cd6ce7e546

View file

@ -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."