From 1e4b5040dd863902658987d15740157fbff69c89 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 24 Dec 2024 01:04:29 +0000 Subject: [PATCH] fix(setup): correctly re-setup tab-bar-notch if needed This allows changes to the tab-bar-notch--face-name frame parameter to be handled correctly, and the relevat face created if needed. Should resolve issues with session managers which may restore all frame parameters. --- tab-bar-notch.el | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tab-bar-notch.el b/tab-bar-notch.el index 1f26a3f..30eb57c 100644 --- a/tab-bar-notch.el +++ b/tab-bar-notch.el @@ -197,15 +197,17 @@ The assigned face name for each frame is stored in a frame parameter." (let* ((frame (or frame (selected-frame))) (face-name (frame-parameter frame 'tab-bar-notch--face-name))) - (if face-name - face-name + (when (not face-name) (setq face-name (intern (format "tab-bar-notch--face-%d" tab-bar-notch--next-face-id)) - tab-bar-notch--next-face-id (1+ tab-bar-notch--next-face-id)) + tab-bar-notch--next-face-id (1+ tab-bar-notch--next-face-id))) + + (when (not (facep face-name)) (make-face face-name) (set-face-attribute face-name nil :height 1.0) - (set-frame-parameter frame 'tab-bar-notch--face-name face-name) - face-name))) + (set-frame-parameter frame 'tab-bar-notch--face-name face-name)) + + face-name)) (defun tab-bar-notch--notch-height (width height) "Return the notch height for the given screen WIDTH and HEIGHT.