Subject: bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse

From: Juri Linkov <[email-masked]>
Date: Mon, 27 Sep 2021 18:39:13 +0300

>> >> Try starting Emacs with a larger font, then.  As in
>> >>
>> >>   emacs -Q -fn "FOO-18"
>> >>
>> >> where FOO is the font you get by default, like "DejaVu Sans Mono" or
>> >> something.
>> >
>> > I'm still not seeing any difference whether the mouse is over the x or
>> > not.
>>
>> I can reproduce this with a very big font on the tab-line, but not tab-bar.
>
> We _are_ talking about the tab-line.

The problem is that hovering mouse over the text property 'mouse-face'
set to 'tab-line-highlight' that contains ':inherit' applies its face
attributes such as :box :line-width twice thus shifting the image upwards.

This patch fixes the problem by copying face attributes from
the inherited face directly to the face used by 'mouse-face':

diff --git a/lisp/tab-line.el b/lisp/tab-line.el
index 4a751b384e..3993e625c9 100644
--- a/lisp/tab-line.el
+++ b/lisp/tab-line.el
@@ -119,7 +119,11 @@ tab-line-tab-current
   :group 'tab-line-faces)
 
 (defface tab-line-highlight
-  '((t :inherit tab-line-tab))
+  '((((class color) (min-colors 88))
+     :box (:line-width 1 :style released-button)
+     :background "grey85"
+     :foreground "black")
+    (t :inverse-video nil))
   "Tab line face for highlighting."
   :version "27.1"
   :group 'tab-line-faces)
--