]> git.eshelyaron.com Git - emacs.git/commitdiff
Make <mouse-2> in mode line more careful as well
authorVisuwesh <visuweshm@gmail.com>
Sun, 26 Jun 2022 15:45:45 +0000 (17:45 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Sun, 26 Jun 2022 15:45:45 +0000 (17:45 +0200)
* lisp/mouse.el (mouse-delete-other-windows): Only delete other
windows if the user didn't move the cursor off the
mode-line (bug#56198).

lisp/mouse.el

index 3b33ba817b228a9b5da9d26ec637694c9e8a58d9..98e49c3598f86109a377e2a84d567471b458067f 100644 (file)
@@ -687,10 +687,13 @@ This command must be bound to a mouse click."
     (switch-to-buffer buf)
     (delete-window window)))
 
-(defun mouse-delete-other-windows ()
+(defun mouse-delete-other-windows (click)
   "Delete all windows except the one you click on."
-  (interactive "@")
-  (delete-other-windows))
+  (interactive "e")
+  (when (and (eq (posn-area (event-end click)) 'mode-line)
+             (eq (posn-window (event-start click))
+                 (posn-window (event-end click))))
+    (delete-other-windows (posn-window (event-start click)))))
 
 (defun mouse-split-window-vertically (click)
   "Select Emacs window mouse is on, then split it vertically in half.