Make buffer-local decorations show up on new window-system frames (Bug#79606)

* lisp/frame.el (make-frame): On window-system frames apply
buffer-local values for fringes, scroll bars and margins of root
and minibuffer window after the new frame was made (Bug#79606).
This commit is contained in:
Martin Rudalics 2025-10-12 10:16:52 +02:00
parent f91de96d03
commit 90ba21979f

View file

@ -1116,6 +1116,34 @@ current buffer even if it is hidden."
(normal-erase-is-backspace-setup-frame frame)
(when (window-system frame)
;; On a window-system frame apply buffer-local values for the
;; fringes, scroll bars and margins of root and minibuffer window
;; of the new frame. The 'frame-creation-function' above could
;; not do that since the frame did not exist yet at the time the
;; buffers for these windows were set (Bug#79606).
(let* ((root (frame-root-window frame))
(buffer (window-buffer root)))
(with-current-buffer buffer
(set-window-fringes
root left-fringe-width right-fringe-width fringes-outside-margins)
(set-window-scroll-bars
root scroll-bar-width vertical-scroll-bar
scroll-bar-height horizontal-scroll-bar)
(set-window-margins
root left-margin-width right-margin-width)))
(let* ((mini (minibuffer-window frame))
(buffer (window-buffer mini)))
(when (eq (window-frame mini) frame)
(with-current-buffer buffer
(set-window-fringes
mini left-fringe-width right-fringe-width fringes-outside-margins)
(set-window-scroll-bars
mini scroll-bar-width vertical-scroll-bar
scroll-bar-height horizontal-scroll-bar)
(set-window-margins
mini left-margin-width right-margin-width)))))
;; We can run `window-configuration-change-hook' for this frame now.
(frame-after-make-frame frame t)
(run-hook-with-args 'after-make-frame-functions frame)