Commit 15a2b2c0 authored by Martin Rudalics's avatar Martin Rudalics

Fix handling of MINIBUF argument in 'walk-window-tree'

* lisp/window.el (walk-window-tree): Handle MINIBUF argument
as advertised when FRAME is minibuffer-only.
(window--resize-apply-p, window--sanitize-window-sizes)
(delete-other-windows, split-window-sensibly): Call
'walk-window-tree' with suitable MINIBUF argument.
parent 712661b4
Pipeline #823 failed with stage
in 52 minutes and 28 seconds
...@@ -571,23 +571,25 @@ FRAME. ...@@ -571,23 +571,25 @@ FRAME.
Optional argument MINIBUF t means run FUN on FRAME's minibuffer Optional argument MINIBUF t means run FUN on FRAME's minibuffer
window even if it isn't active. MINIBUF nil or omitted means run window even if it isn't active. MINIBUF nil or omitted means run
FUN on FRAME's minibuffer window only if it's active. In both FUN on FRAME's minibuffer window only if it's active. In either
cases the minibuffer window must be part of FRAME. MINIBUF case the minibuffer window must be part of FRAME. MINIBUF
neither nil nor t means never run FUN on the minibuffer window. neither nil nor t means never run FUN on the minibuffer window.
This function performs a pre-order, depth-first traversal of the This function performs a pre-order, depth-first traversal of the
window tree. If FUN changes the window tree, the result is window tree. If FUN changes the window tree, the result is
unpredictable." unpredictable."
(setq frame (window-normalize-frame frame)) (let ((root (frame-root-window frame))
(walk-window-tree-1 fun (frame-root-window frame) any) (mini (minibuffer-window frame)))
(when (memq minibuf '(nil t)) (setq frame (window-normalize-frame frame))
(unless (eq root mini)
(walk-window-tree-1 fun root any))
;; Run FUN on FRAME's minibuffer window if requested. ;; Run FUN on FRAME's minibuffer window if requested.
(let ((minibuffer-window (minibuffer-window frame))) (when (and (window-live-p mini)
(when (and (window-live-p minibuffer-window) (eq (window-frame mini) frame)
(eq (window-frame minibuffer-window) frame) (or (eq minibuf t)
(or (eq minibuf t) (and (not minibuf)
(minibuffer-window-active-p minibuffer-window))) (minibuffer-window-active-p mini))))
(funcall fun minibuffer-window))))) (funcall fun mini))))
(defun walk-window-subtree (fun &optional window any) (defun walk-window-subtree (fun &optional window any)
"Run function FUN on the subtree of windows rooted at WINDOW. "Run function FUN on the subtree of windows rooted at WINDOW.
...@@ -2773,7 +2775,7 @@ shall be resized horizontally." ...@@ -2773,7 +2775,7 @@ shall be resized horizontally."
(unless (= (window-new-pixel window) (unless (= (window-new-pixel window)
(window-size window horizontal t)) (window-size window horizontal t))
(throw 'apply t))) (throw 'apply t)))
frame t) frame t t)
nil)) nil))
(defun window-resize (window delta &optional horizontal ignore pixelwise) (defun window-resize (window delta &optional horizontal ignore pixelwise)
...@@ -3393,7 +3395,8 @@ may happen when the FRAME is not large enough to accommodate it." ...@@ -3393,7 +3395,8 @@ may happen when the FRAME is not large enough to accommodate it."
(when (> delta 0) (when (> delta 0)
(if (window-resizable-p window delta horizontal nil t) (if (window-resizable-p window delta horizontal nil t)
(window-resize window delta horizontal nil t) (window-resize window delta horizontal nil t)
(setq value nil)))))) (setq value nil)))))
nil nil 'nomini)
value)) value))
(defun adjust-window-trailing-edge (window delta &optional horizontal pixelwise) (defun adjust-window-trailing-edge (window delta &optional horizontal pixelwise)
...@@ -4171,7 +4174,8 @@ any window whose `no-delete-other-windows' parameter is non-nil." ...@@ -4171,7 +4174,8 @@ any window whose `no-delete-other-windows' parameter is non-nil."
(and (not (window-parameter other 'window-side)) (and (not (window-parameter other 'window-side))
(window-parameter (window-parameter
other 'no-delete-other-windows))) other 'no-delete-other-windows)))
(throw 'tag nil)))) (throw 'tag nil)))
nil nil 'nomini)
t) t)
(setq main (window-main-window frame))) (setq main (window-main-window frame)))
(t (t
...@@ -6655,7 +6659,7 @@ split." ...@@ -6655,7 +6659,7 @@ split."
(unless (or (eq w window) (unless (or (eq w window)
(window-dedicated-p w)) (window-dedicated-p w))
(throw 'done nil))) (throw 'done nil)))
frame) frame nil 'nomini)
t))) t)))
(not (window-minibuffer-p window)) (not (window-minibuffer-p window))
(let ((split-height-threshold 0)) (let ((split-height-threshold 0))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment