mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-03 10:53:23 +00:00
* lisp/tab-bar.el: Ignore daemon's initial frame (bug#78896).
(tab-bar--update-tab-bar-lines): Don't set the frame parameter 'tab-bar-lines' in daemon's initial frame because it messes up the frames when 'format-mode-line' called from 'tab-bar-format-global' on daemon's initial frame forces focus switch to daemon's initial frame. Also don't set 'default-frame-alist' in daemon mode because 'frame-notice-user-settings' copies the frame parameter 'tab-bar-lines' from 'default-frame-alist' to daemon's initial frame. Here updating 'default-frame-alist' is not much needed anyway since the frame parameter 'tab-bar-lines' for new frames is set in 'make_terminal_frame' and 'x-create-frame'. 'default-frame-alist' might be need only to handle non-default 'tab-bar-show', but this can be handled by 'toggle-frame-tab-bar' called from 'server-after-make-frame-hook'. (toggle-frame-tab-bar): Document a useful case of calling it from 'server-after-make-frame-hook'.
This commit is contained in:
parent
e25ee1082f
commit
cd8319677d
1 changed files with 9 additions and 3 deletions
|
@ -280,11 +280,13 @@ a list of frames to update."
|
|||
(dolist (frame frame-lst)
|
||||
(unless (or (frame-parameter frame 'tab-bar-lines-keep-state)
|
||||
(and (eq auto-resize-tab-bars 'grow-only)
|
||||
(> (frame-parameter frame 'tab-bar-lines) 1)))
|
||||
(> (frame-parameter frame 'tab-bar-lines) 1))
|
||||
;; Don't enable tab-bar in daemon's initial frame.
|
||||
(and (daemonp) (not (frame-parameter frame 'client))))
|
||||
(set-frame-parameter frame 'tab-bar-lines
|
||||
(tab-bar--tab-bar-lines-for-frame frame)))))
|
||||
;; Update `default-frame-alist'
|
||||
(when (eq frames t)
|
||||
(when (and (eq frames t) (not (daemonp)))
|
||||
(setq default-frame-alist
|
||||
(cons (cons 'tab-bar-lines
|
||||
(if (and tab-bar-mode (eq tab-bar-show t)) 1 0))
|
||||
|
@ -600,7 +602,11 @@ on each new frame when the global `tab-bar-mode' is disabled,
|
|||
or if you want to disable the tab bar individually on each
|
||||
new frame when the global `tab-bar-mode' is enabled, by using
|
||||
|
||||
(add-hook \\='after-make-frame-functions #\\='toggle-frame-tab-bar)"
|
||||
(add-hook \\='after-make-frame-functions #\\='toggle-frame-tab-bar)
|
||||
|
||||
Or when starting Emacs in daemon mode:
|
||||
|
||||
(add-hook \\='server-after-make-frame-hook #\\='toggle-frame-tab-bar)"
|
||||
(interactive)
|
||||
(set-frame-parameter frame 'tab-bar-lines
|
||||
(if (> (frame-parameter frame 'tab-bar-lines) 0) 0 1))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue