diff --git a/lisp/frame.el b/lisp/frame.el index f07a59c78d2..b6641ca716a 100644 --- a/lisp/frame.el +++ b/lisp/frame.el @@ -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)