GNU bug report logs - #50424
27.2; Tab bar button mouse face not clearing entirely

Previous Next

Package: emacs;

Reported by: Po Lu <luangruo <at> yahoo.com>

Date: Mon, 6 Sep 2021 08:14:02 UTC

Severity: normal

Tags: fixed

Found in version 27.2

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #71 received at 50424 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: luangruo <at> yahoo.com, 50424 <at> debbugs.gnu.org, alan <at> idiocy.org
Subject: Re: bug#50424: 27.2; Tab bar button mouse face not clearing entirely
Date: Sun, 12 Sep 2021 10:06:09 +0300
[Message part 1 (text/plain, inline)]
>> >> With enlarged height and width, now the buttons are not vertically
>> >> aligned:
>> >
>> > Is this a screenshot of a tab bar or of a tab line?
>>
>> Tab bar.  And the change was caused by your commit db74a93659.
>
> Then I don't understand the two horizontally-adjacent images.  What
> are they? two separate frame?  If they are two frames, then where are
> the frame decorations?  In short, I don't understand what am I seeing
> there, and how did you get this display.

These are two separate images that show the changed tab dimensions
before changes when :margin was (2 . 0), and after changes
when now :margin is 4.

> And also, when you say "buttons are not vertically aligned", what
> exactly do you mean?  Not aligned with what?

Now buttons are not aligned to the baseline, and thus are
not centered vertically anymore.

>> db74a93659 that contains such changes:
>>
>> - :margin (2 . 0)
>> + :margin ,tab-bar-button-margin
>
> This is to make the code do what the variable's documentation says.
> Without that change, the images were sized using :margin '(2 . 0)',
> but the C code used the value of tab-bar-button-margin, a simple
> scalar, to place the image and clear its background.  The way to
> affect the image dimensions is by changing the value of
> tab-bar-button-margin, not by hard-coding the margin in the image
> properties.

This patch restores the original tab dimensions, while also keeps fixed
the reported problem of mouse face not clearing entirely:

[tab-bar-button-margin.patch (text/x-diff, inline)]
diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 8be08d4b8b..edbadec09d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -161,7 +161,7 @@ tab-bar--load-buttons
     (add-text-properties 0 (length tab-bar-new-button)
                          `(display (image :type xpm
                                           :file "tabs/new.xpm"
-                                          :margin ,tab-bar-button-margin
+                                          :margin ,(cons tab-bar-button-margin 0)
                                           :ascent center))
                          tab-bar-new-button))
 
@@ -171,7 +171,7 @@ tab-bar--load-buttons
     (add-text-properties 0 (length tab-bar-close-button)
                          `(display (image :type xpm
                                           :file "tabs/close.xpm"
-                                          :margin ,tab-bar-button-margin
+                                          :margin ,(cons tab-bar-button-margin 0)
                                           :ascent center))
                          tab-bar-close-button)))
 
@@ -1659,7 +1659,7 @@ tab-bar-history-mode
           (add-text-properties 0 (length tab-bar-back-button)
                                `(display (image :type xpm
                                                 :file "tabs/left-arrow.xpm"
-                                                :margin ,tab-bar-button-margin
+                                                :margin ,(cons tab-bar-button-margin 0)
                                                 :ascent center))
                                tab-bar-back-button))
         (when (and tab-bar-mode (not (get-text-property 0 'display tab-bar-forward-button)))
@@ -1667,7 +1667,7 @@ tab-bar-history-mode
           (add-text-properties 0 (length tab-bar-forward-button)
                                `(display (image :type xpm
                                                 :file "tabs/right-arrow.xpm"
-                                                :margin ,tab-bar-button-margin
+                                                :margin ,(cons tab-bar-button-margin 0)
                                                 :ascent center))
                                tab-bar-forward-button))
 
diff --git a/src/dispextern.h b/src/dispextern.h
index f4c7575b35..0ede76ebf5 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -3202,7 +3202,7 @@ #define IMAGE_CACHE_BUCKETS_SIZE 1001
 
 /* Default values of the above variables.  */
 
-#define DEFAULT_TAB_BAR_BUTTON_MARGIN 4
+#define DEFAULT_TAB_BAR_BUTTON_MARGIN 2
 #define DEFAULT_TAB_BAR_BUTTON_RELIEF 1
 
 /* The height in pixels of the default tab-bar images.  */

This bug report was last modified 3 years and 288 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.