diff options
| author | Juri Linkov | 2025-06-27 20:41:05 +0300 |
|---|---|---|
| committer | Juri Linkov | 2025-06-27 20:41:05 +0300 |
| commit | cd8319677d8869d60fefca6d88cf994726058e9e (patch) | |
| tree | feb5a2a1723d989904a0a01b9d8d7ae357ed16e3 | |
| parent | e25ee1082f74c65b81ba4a184cfc29b26c2bf3b9 (diff) | |
| download | emacs-cd8319677d8869d60fefca6d88cf994726058e9e.tar.gz emacs-cd8319677d8869d60fefca6d88cf994726058e9e.zip | |
* 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'.
| -rw-r--r-- | lisp/tab-bar.el | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 306fed34e40..7dc39086044 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el | |||
| @@ -280,11 +280,13 @@ a list of frames to update." | |||
| 280 | (dolist (frame frame-lst) | 280 | (dolist (frame frame-lst) |
| 281 | (unless (or (frame-parameter frame 'tab-bar-lines-keep-state) | 281 | (unless (or (frame-parameter frame 'tab-bar-lines-keep-state) |
| 282 | (and (eq auto-resize-tab-bars 'grow-only) | 282 | (and (eq auto-resize-tab-bars 'grow-only) |
| 283 | (> (frame-parameter frame 'tab-bar-lines) 1))) | 283 | (> (frame-parameter frame 'tab-bar-lines) 1)) |
| 284 | ;; Don't enable tab-bar in daemon's initial frame. | ||
| 285 | (and (daemonp) (not (frame-parameter frame 'client)))) | ||
| 284 | (set-frame-parameter frame 'tab-bar-lines | 286 | (set-frame-parameter frame 'tab-bar-lines |
| 285 | (tab-bar--tab-bar-lines-for-frame frame))))) | 287 | (tab-bar--tab-bar-lines-for-frame frame))))) |
| 286 | ;; Update `default-frame-alist' | 288 | ;; Update `default-frame-alist' |
| 287 | (when (eq frames t) | 289 | (when (and (eq frames t) (not (daemonp))) |
| 288 | (setq default-frame-alist | 290 | (setq default-frame-alist |
| 289 | (cons (cons 'tab-bar-lines | 291 | (cons (cons 'tab-bar-lines |
| 290 | (if (and tab-bar-mode (eq tab-bar-show t)) 1 0)) | 292 | (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, | |||
| 600 | or if you want to disable the tab bar individually on each | 602 | or if you want to disable the tab bar individually on each |
| 601 | new frame when the global `tab-bar-mode' is enabled, by using | 603 | new frame when the global `tab-bar-mode' is enabled, by using |
| 602 | 604 | ||
| 603 | (add-hook \\='after-make-frame-functions #\\='toggle-frame-tab-bar)" | 605 | (add-hook \\='after-make-frame-functions #\\='toggle-frame-tab-bar) |
| 606 | |||
| 607 | Or when starting Emacs in daemon mode: | ||
| 608 | |||
| 609 | (add-hook \\='server-after-make-frame-hook #\\='toggle-frame-tab-bar)" | ||
| 604 | (interactive) | 610 | (interactive) |
| 605 | (set-frame-parameter frame 'tab-bar-lines | 611 | (set-frame-parameter frame 'tab-bar-lines |
| 606 | (if (> (frame-parameter frame 'tab-bar-lines) 0) 0 1)) | 612 | (if (> (frame-parameter frame 'tab-bar-lines) 0) 0 1)) |