From df51e19deadae72ab02ab83b3acb3b311925bd1e Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sun, 13 Oct 2024 09:48:05 +0200 Subject: [PATCH] Fix bug when splitting a frame's root window (Bug#73627) * lisp/window.el (split-window): Split main window of WINDOW's frame when that frame has side windows (Bug#73627). (cherry picked from commit a58dc58fec8dc146cf10454c6a2b3174d1b4c2f8) --- lisp/window.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/window.el b/lisp/window.el index 712a9ccae04..fed94bb8e6c 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -5547,6 +5547,13 @@ frame. The selected window is not changed by this function." (setq atom-root (window-atom-root window)) (not (eq atom-root window))) (throw 'done (split-window atom-root size side pixelwise))) + ;; If WINDOW's frame has a side window and WINDOW specifies the + ;; frame's root window, split the frame's main window instead + ;; (Bug#73627). + ((and (eq window (frame-root-window frame)) + (window-with-parameter 'window-side nil frame)) + (throw 'done (split-window (window-main-window frame) + size side pixelwise))) ;; If WINDOW is a side window or its first or last child is a ;; side window, throw an error unless `window-combination-resize' ;; equals 'side. -- 2.39.5