From: Juri Linkov Date: Thu, 5 May 2022 18:08:30 +0000 (+0300) Subject: * lisp/desktop.el: Enable tab-bar-mode after restoring frames with a tab bar. X-Git-Tag: emacs-29.0.90~1931^2~39 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=459d5ff8ad72dab8831635e3d914389982041ad2;p=emacs.git * lisp/desktop.el: Enable tab-bar-mode after restoring frames with a tab bar. (desktop-restore-frameset): Enable tab-bar-mode when a restored frame contains the frame parameter tab-bar-lines (bug#55070). --- diff --git a/lisp/desktop.el b/lisp/desktop.el index e438b98c0e4..1a4103e2090 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -1269,7 +1269,16 @@ being set (usually, by reading it from the desktop)." :cleanup-frames (not (eq desktop-restore-reuses-frames 'keep)) :force-display desktop-restore-in-current-display :force-onscreen (and desktop-restore-forces-onscreen - (display-graphic-p))))) + (display-graphic-p))) + ;; When at least one restored frame contains a tab bar, + ;; enable `tab-bar-mode' that takes care about recalculating + ;; the correct values of the frame parameter `tab-bar-lines' + ;; (that depends on `tab-bar-show'), and also loads graphical buttons. + (when (seq-some + (lambda (frame) + (menu-bar-positive-p (frame-parameter frame 'tab-bar-lines))) + (frame-list)) + (tab-bar-mode 1)))) ;; Just to silence the byte compiler. ;; Dynamically bound in `desktop-read'.