]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/desktop.el: Enable tab-bar-mode after restoring frames with a tab bar.
authorJuri Linkov <juri@linkov.net>
Thu, 5 May 2022 18:08:30 +0000 (21:08 +0300)
committerJuri Linkov <juri@linkov.net>
Thu, 5 May 2022 18:08:30 +0000 (21:08 +0300)
(desktop-restore-frameset): Enable tab-bar-mode when a restored frame
contains the frame parameter tab-bar-lines (bug#55070).

lisp/desktop.el

index e438b98c0e42427159197e89fdad1d2c5494e905..1a4103e20907ed9d40b3392dbd9957c9add51c36 100644 (file)
@@ -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'.