Improve the previous fix in toggle-window-dedicated

* lisp/window.el (toggle-window-dedicated):
Don't select the window by mouse click in another window.
This keeps the currently selected window like for
toggling other indicators on the mode-line (bug#81178).
This commit is contained in:
Juri Linkov 2026-06-26 18:37:07 +03:00
parent f2c4c1029d
commit 1381479572

View file

@ -7993,7 +7993,13 @@ variable to t, strong dedication will be used by default and
\\[universal-argument] will make the window weakly dedicated.
See the info node `(elisp)Dedicated Windows' for more details."
(interactive "@i\nP\np")
(interactive "i\nP\np")
(when (and (not window) (mouse-event-p last-input-event))
(let ((event-window (posn-window (event-start last-input-event))))
(unless (eq (selected-window) event-window)
(setq window event-window))))
(setq window (window-normalize-window window))
(setq flag (cond
((consp flag)