* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse [not found] <8735ptxhzs.fsf.ref@yahoo.com> @ 2021-09-25 6:54 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-09-25 7:17 ` Lars Ingebrigtsen 2021-09-25 7:59 ` Eli Zaretskii 0 siblings, 2 replies; 29+ messages in thread From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-25 6:54 UTC (permalink / raw) To: 50798 The close button for each tab in a tab line is off-center unless it's under mouse face. Enable tab-line-mode, and compare the position of the close button (X) in any tab when it is under mouse face to when it is not. The difference is quite obvious. In GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars) of 2021-09-25 built on chomper Windowing system distributor 'The X.Org Foundation', version 11.0.12101002 System Description: Fedora 34 (Workstation Edition) Configured using: 'configure --with-native-compilation --with-x-toolkit=lucid --with-imagemagick' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK JPEG JSON LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM LUCID ZLIB ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 6:54 ` bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-25 7:17 ` Lars Ingebrigtsen 2021-09-25 8:00 ` Eli Zaretskii 2021-09-25 7:59 ` Eli Zaretskii 1 sibling, 1 reply; 29+ messages in thread From: Lars Ingebrigtsen @ 2021-09-25 7:17 UTC (permalink / raw) To: 50798; +Cc: Po Lu Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> writes: > The close button for each tab in a tab line is off-center unless it's > under mouse face. > > Enable tab-line-mode, and compare the position of the close button (X) > in any tab when it is under mouse face to when it is not. The > difference is quite obvious. I'm unable to reproduce the problem, but: > In GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, X toolkit, cairo > version 1.16.0, Xaw scroll bars) I'm using a Gtk Emacs, so perhaps that makes a difference. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 7:17 ` Lars Ingebrigtsen @ 2021-09-25 8:00 ` Eli Zaretskii 2021-09-25 8:19 ` Lars Ingebrigtsen 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-09-25 8:00 UTC (permalink / raw) To: Lars Ingebrigtsen; +Cc: luangruo, 50798 > From: Lars Ingebrigtsen <larsi@gnus.org> > Date: Sat, 25 Sep 2021 09:17:03 +0200 > Cc: Po Lu <luangruo@yahoo.com> > > Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text > editors" <bug-gnu-emacs@gnu.org> writes: > > > The close button for each tab in a tab line is off-center unless it's > > under mouse face. > > > > Enable tab-line-mode, and compare the position of the close button (X) > > in any tab when it is under mouse face to when it is not. The > > difference is quite obvious. > > I'm unable to reproduce the problem You need to have at least two tab-line buttons to see that, because it only shows on the non-current tab. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 8:00 ` Eli Zaretskii @ 2021-09-25 8:19 ` Lars Ingebrigtsen 2021-09-25 8:22 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Lars Ingebrigtsen @ 2021-09-25 8:19 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, 50798 Eli Zaretskii <eliz@gnu.org> writes: > You need to have at least two tab-line buttons to see that, because it > only shows on the non-current tab. I did: emacs -Q M-x tab-line-mode M-x tab-new M-x tab-new And I'm not seeing any oddities when putting the mouse pointer over any parts of the tab line. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 8:19 ` Lars Ingebrigtsen @ 2021-09-25 8:22 ` Eli Zaretskii 2021-09-25 8:30 ` Lars Ingebrigtsen 2021-09-25 8:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 0 siblings, 2 replies; 29+ messages in thread From: Eli Zaretskii @ 2021-09-25 8:22 UTC (permalink / raw) To: Lars Ingebrigtsen; +Cc: luangruo, 50798 > From: Lars Ingebrigtsen <larsi@gnus.org> > Cc: 50798@debbugs.gnu.org, luangruo@yahoo.com > Date: Sat, 25 Sep 2021 10:19:31 +0200 > > Eli Zaretskii <eliz@gnu.org> writes: > > > You need to have at least two tab-line buttons to see that, because it > > only shows on the non-current tab. > > I did: > > emacs -Q > M-x tab-line-mode > M-x tab-new > M-x tab-new > > And I'm not seeing any oddities when putting the mouse pointer over any > parts of the tab line. 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. AFAIR, the tab-line display is entirely handled by the Emacs native display features, so GTK should not have any effect on that. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 8:22 ` Eli Zaretskii @ 2021-09-25 8:30 ` Lars Ingebrigtsen 2021-09-25 18:53 ` Juri Linkov 2021-09-25 8:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 1 sibling, 1 reply; 29+ messages in thread From: Lars Ingebrigtsen @ 2021-09-25 8:30 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, 50798 [-- Attachment #1: Type: text/plain, Size: 295 bytes --] Eli Zaretskii <eliz@gnu.org> writes: > 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. No mouse: [-- Attachment #2: Type: image/png, Size: 5790 bytes --] [-- Attachment #3: Type: text/plain, Size: 38 bytes --] Mouse over the x in the second tab: [-- Attachment #4: Type: image/png, Size: 5707 bytes --] [-- Attachment #5: Type: text/plain, Size: 162 bytes --] The x doesn't move -- it just gets the relief around it. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 8:30 ` Lars Ingebrigtsen @ 2021-09-25 18:53 ` Juri Linkov 2021-09-25 19:44 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-09-25 18:53 UTC (permalink / raw) To: Lars Ingebrigtsen; +Cc: luangruo, 50798 >> 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. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 18:53 ` Juri Linkov @ 2021-09-25 19:44 ` Eli Zaretskii 2021-09-26 5:33 ` Lars Ingebrigtsen 2021-09-27 15:39 ` Juri Linkov 0 siblings, 2 replies; 29+ messages in thread From: Eli Zaretskii @ 2021-09-25 19:44 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: Eli Zaretskii <eliz@gnu.org>, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Sat, 25 Sep 2021 21:53:25 +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. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 19:44 ` Eli Zaretskii @ 2021-09-26 5:33 ` Lars Ingebrigtsen 2021-09-27 15:39 ` Juri Linkov 1 sibling, 0 replies; 29+ messages in thread From: Lars Ingebrigtsen @ 2021-09-26 5:33 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, 50798, Juri Linkov Eli Zaretskii <eliz@gnu.org> writes: >> I can reproduce this with a very big font on the tab-line, but not tab-bar. > > We _are_ talking about the tab-line. Oh! `M-x new-tab' is opening a new tab bar, not a new entry on the tab line. :-/ Yes, I can see the problem, too, on the tab line. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 19:44 ` Eli Zaretskii 2021-09-26 5:33 ` Lars Ingebrigtsen @ 2021-09-27 15:39 ` Juri Linkov 2021-09-27 18:40 ` Eli Zaretskii 1 sibling, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-09-27 15:39 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 >> >> 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) -- ^ permalink raw reply related [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-27 15:39 ` Juri Linkov @ 2021-09-27 18:40 ` Eli Zaretskii 2021-09-28 18:46 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-09-27 18:40 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Mon, 27 Sep 2021 18:39:13 +0300 > > 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. Sounds like a potential bug. Hod did you see that these attributes were applied twice? And why applying the same attribute twice causes effects that are different from applying it once? ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-27 18:40 ` Eli Zaretskii @ 2021-09-28 18:46 ` Juri Linkov 2021-10-02 10:08 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-09-28 18:46 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 >> 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. > > Sounds like a potential bug. Hod did you see that these attributes > were applied twice? And why applying the same attribute twice causes > effects that are different from applying it once? It was a guess that it's applied twice. Maybe there is another bug. At looked at the depths of 'note_mode_line_or_margin_highlight', but don't understand what is wrong. Some X coords are miscalculated when the mouse-face is inherited from the face with with :line-width 1. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-28 18:46 ` Juri Linkov @ 2021-10-02 10:08 ` Eli Zaretskii 2021-10-02 19:36 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-10-02 10:08 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Tue, 28 Sep 2021 21:46:28 +0300 > > >> 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. > > > > Sounds like a potential bug. Hod did you see that these attributes > > were applied twice? And why applying the same attribute twice causes > > effects that are different from applying it once? > > It was a guess that it's applied twice. Maybe there is another bug. > At looked at the depths of 'note_mode_line_or_margin_highlight', > but don't understand what is wrong. Some X coords are miscalculated > when the mouse-face is inherited from the face with with :line-width 1. Please tell more about what you saw there. Which X coordinates are miscalculated? And I don't think I understand the arrangement with faces for the close button. tab-line.el says: (defvar tab-line-close-button (propertize " x" 'display '(image :type xpm :file "tabs/close.xpm" :margin (2 . 0) :ascent center) 'keymap tab-line-tab-close-map 'mouse-face 'tab-line-close-highlight 'help-echo "Click to close tab") "Button for closing the clicked tab.") which seems to mean we should use 'tab-line-close-highlight' as the mouse-face for this button. But if I invoke (tab-line-format), which seems to be what calculates the tab-line-format, I see this: (#(" xdisp.c x" 1 8 (tab #<buffer xdisp.c> face tab-line-tab-inactive mouse-face tab-line-highlight keymap (keymap (13 . tab-line-select-tab) (tab-line keymap (down-mouse-3 . tab-line-tab-context-menu) (mouse-2 . tab-line-close-tab) (down-mouse-1 . tab-line-select-tab))) follow-link ignore) 8 10 (tab #<buffer xdisp.c> face tab-line-tab-inactive display (image :type xpm :file "tabs/close.xpm" :margin (2 . 0) :ascent center) keymap (keymap (tab-line keymap (mouse-2 . tab-line-close-tab) (mouse-1 . tab-line-close-tab))) mouse-face tab-line-highlight ... which seems to say we actually use the 'tab-line-highlight' face instead for the close button? Could you please describe how mouse-highlight faces are supposed to work with tab-line close buttons, and preferably walk me through the relevant code? ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-02 10:08 ` Eli Zaretskii @ 2021-10-02 19:36 ` Juri Linkov 2021-10-03 11:49 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-10-02 19:36 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 > Please tell more about what you saw there. Which X coordinates are > miscalculated? > > And I don't think I understand the arrangement with faces for the > close button. tab-line.el says: > > (defvar tab-line-close-button > (propertize " x" > 'display '(image :type xpm > :file "tabs/close.xpm" > :margin (2 . 0) > :ascent center) > 'keymap tab-line-tab-close-map > 'mouse-face 'tab-line-close-highlight > 'help-echo "Click to close tab") > "Button for closing the clicked tab.") > > which seems to mean we should use 'tab-line-close-highlight' as the > mouse-face for this button. But if I invoke (tab-line-format), which > seems to be what calculates the tab-line-format, I see this: > > (#(" xdisp.c x" > 1 8 > (tab #<buffer xdisp.c> > face tab-line-tab-inactive > mouse-face tab-line-highlight > follow-link ignore) > 8 10 > (tab #<buffer xdisp.c> > face tab-line-tab-inactive > display (image :type xpm :file "tabs/close.xpm" :margin (2 . 0) :ascent center) > mouse-face tab-line-highlight ... > > which seems to say we actually use the 'tab-line-highlight' face > instead for the close button? > > Could you please describe how mouse-highlight faces are supposed to > work with tab-line close buttons, and preferably walk me through the > relevant code? 'tab-line-close-highlight' was supposed to be applied to the close button to emulate how the close button behaves on the tab bar where hovering mouse over the button displays it with the face style 'released-button'. But mouse-face of the face 'tab-line-highlight' overrides the mouse-face 'tab-line-close-highlight' in 'tab-line-tab-name-format-default' that applies 'propertize' with 'mouse-face tab-line-highlight'. And I can't find a way how to keep the existing 'mouse-face' property on the close button while applying 'mouse-face tab-line-highlight' to the rest of the tab. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-02 19:36 ` Juri Linkov @ 2021-10-03 11:49 ` Eli Zaretskii 2021-10-03 16:51 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-10-03 11:49 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Sat, 02 Oct 2021 22:36:15 +0300 > > > (defvar tab-line-close-button > > (propertize " x" > > 'display '(image :type xpm > > :file "tabs/close.xpm" > > :margin (2 . 0) > > :ascent center) > > 'keymap tab-line-tab-close-map > > 'mouse-face 'tab-line-close-highlight > > 'help-echo "Click to close tab") > > "Button for closing the clicked tab.") > > > > which seems to mean we should use 'tab-line-close-highlight' as the > > mouse-face for this button. But if I invoke (tab-line-format), which > > seems to be what calculates the tab-line-format, I see this: > > > > (#(" xdisp.c x" > > 1 8 > > (tab #<buffer xdisp.c> > > face tab-line-tab-inactive > > mouse-face tab-line-highlight > > follow-link ignore) > > 8 10 > > (tab #<buffer xdisp.c> > > face tab-line-tab-inactive > > display (image :type xpm :file "tabs/close.xpm" :margin (2 . 0) :ascent center) > > mouse-face tab-line-highlight ... > > > > which seems to say we actually use the 'tab-line-highlight' face > > instead for the close button? > > > > Could you please describe how mouse-highlight faces are supposed to > > work with tab-line close buttons, and preferably walk me through the > > relevant code? > > 'tab-line-close-highlight' was supposed to be applied to the close button > to emulate how the close button behaves on the tab bar where hovering mouse > over the button displays it with the face style 'released-button'. > > But mouse-face of the face 'tab-line-highlight' overrides the mouse-face > 'tab-line-close-highlight' in 'tab-line-tab-name-format-default' > that applies 'propertize' with 'mouse-face tab-line-highlight'. > And I can't find a way how to keep the existing 'mouse-face' property on > the close button while applying 'mouse-face tab-line-highlight' to the > rest of the tab. I'm not sure I follow: it is your code in tab-line-tab-name-format-default that applies the tab-line-highlight as mouse-face to the button: (apply 'propertize (concat (propertize name 'keymap tab-line-tab-map ;; Don't turn mouse-1 into mouse-2 (bug#49247) 'follow-link 'ignore) (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab)) tab-line-close-button-show (not (eq tab-line-close-button-show (if selected-p 'non-selected 'selected))) tab-line-close-button) "")) `( tab ,tab ,@(if selected-p '(selected t)) face ,face mouse-face tab-line-highlight)))) You should be able not to do that for the close button. Or am I missing something? ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-03 11:49 ` Eli Zaretskii @ 2021-10-03 16:51 ` Juri Linkov 2021-10-03 17:22 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-10-03 16:51 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 [-- Attachment #1: Type: text/plain, Size: 1455 bytes --] > I'm not sure I follow: it is your code in > tab-line-tab-name-format-default that applies the tab-line-highlight > as mouse-face to the button: > > (apply 'propertize > (concat (propertize name > 'keymap tab-line-tab-map > ;; Don't turn mouse-1 into mouse-2 (bug#49247) > 'follow-link 'ignore) > (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab)) > tab-line-close-button-show > (not (eq tab-line-close-button-show > (if selected-p 'non-selected 'selected))) > tab-line-close-button) > "")) > `( > tab ,tab > ,@(if selected-p '(selected t)) > face ,face > mouse-face tab-line-highlight)))) > > You should be able not to do that for the close button. Or am I > missing something? It's possible to put properties on the close button only, but wouldn't this be too ugly? This means that hovering the mouse over the tab name will highlight only the tab name without highlighting the close button. And hovering the mouse over the close button will highlight only the close button without highlighting the tab name. So highlighting will be separate for the close button and the rest of the tab with such patch: [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: tab-line-close-highlight.patch --] [-- Type: text/x-diff, Size: 2279 bytes --] diff --git a/lisp/tab-line.el b/lisp/tab-line.el index 4a751b384e..daaa5531ef 100644 --- a/lisp/tab-line.el +++ b/lisp/tab-line.el @@ -125,7 +125,11 @@ tab-line-highlight :group 'tab-line-faces) (defface tab-line-close-highlight - '((t :foreground "red")) + '((((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 of the close button." :version "27.1" :group 'tab-line-faces) @@ -481,22 +485,23 @@ tab-line-tab-name-format-default 'tab-line-tab-inactive))) (dolist (fn tab-line-tab-face-functions) (setf face (funcall fn tab tabs face buffer-p selected-p))) - (apply 'propertize - (concat (propertize name - 'keymap tab-line-tab-map - ;; Don't turn mouse-1 into mouse-2 (bug#49247) - 'follow-link 'ignore) - (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab)) - tab-line-close-button-show - (not (eq tab-line-close-button-show - (if selected-p 'non-selected 'selected))) - tab-line-close-button) - "")) - `( - tab ,tab - ,@(if selected-p '(selected t)) - face ,face - mouse-face tab-line-highlight)))) + (concat + (apply 'propertize name + `( + tab ,tab + ,@(if selected-p '(selected t)) + face ,face + mouse-face tab-line-highlight + keymap ,tab-line-tab-map + ;; Don't turn mouse-1 into mouse-2 (bug#49247) + follow-link ignore + )) + (or (and (or buffer-p (assq 'buffer tab) (assq 'close tab)) + tab-line-close-button-show + (not (eq tab-line-close-button-show + (if selected-p 'non-selected 'selected))) + (propertize tab-line-close-button 'face face)) + "")))) (defun tab-line-format-template (tabs) "Template for displaying tab line for selected window." ^ permalink raw reply related [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-03 16:51 ` Juri Linkov @ 2021-10-03 17:22 ` Eli Zaretskii 2021-10-03 17:42 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-10-03 17:22 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Sun, 03 Oct 2021 19:51:40 +0300 > > > `( > > tab ,tab > > ,@(if selected-p '(selected t)) > > face ,face > > mouse-face tab-line-highlight)))) > > > > You should be able not to do that for the close button. Or am I > > missing something? > > It's possible to put properties on the close button only, but wouldn't this be > too ugly? This means that hovering the mouse over the tab name will highlight only > the tab name without highlighting the close button. And hovering the mouse > over the close button will highlight only the close button without highlighting > the tab name. How did you intend this to look? You said previously: > 'tab-line-close-highlight' was supposed to be applied to the close button > to emulate how the close button behaves on the tab bar where hovering mouse > over the button displays it with the face style 'released-button'. > > But mouse-face of the face 'tab-line-highlight' overrides the mouse-face > 'tab-line-close-highlight' in 'tab-line-tab-name-format-default' > that applies 'propertize' with 'mouse-face tab-line-highlight'. If what you intended was not to highlight the close button differently, then what was the intent? > So highlighting will be separate for the close button and > the rest of the tab with such patch: Does this solve the problem with vertical movement of the button? ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-03 17:22 ` Eli Zaretskii @ 2021-10-03 17:42 ` Juri Linkov 2021-10-03 18:00 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-10-03 17:42 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 >> It's possible to put properties on the close button only, but wouldn't this be >> too ugly? This means that hovering the mouse over the tab name will highlight only >> the tab name without highlighting the close button. And hovering the mouse >> over the close button will highlight only the close button without highlighting >> the tab name. > > How did you intend this to look? You said previously: > >> 'tab-line-close-highlight' was supposed to be applied to the close button >> to emulate how the close button behaves on the tab bar where hovering mouse >> over the button displays it with the face style 'released-button'. >> >> But mouse-face of the face 'tab-line-highlight' overrides the mouse-face >> 'tab-line-close-highlight' in 'tab-line-tab-name-format-default' >> that applies 'propertize' with 'mouse-face tab-line-highlight'. > > If what you intended was not to highlight the close button > differently, then what was the intent? The intent for the close button was to look exactly like the close button on the tab-bar. Well, almost. Because while the close button hovering looks nice on the tab-bar, it has another problem that hovering its tab doesn't highlight it like mouse-face highlights the tab on the tab-line. So both the tab-bar and the tab-line are still not perfect. >> So highlighting will be separate for the close button and >> the rest of the tab with such patch: > > Does this solve the problem with vertical movement of the button? It solves the problem because tab-line-close-highlight doesn't inherit from other faces. It's face inheritance that caused the problem with vertical movement of the button. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-03 17:42 ` Juri Linkov @ 2021-10-03 18:00 ` Eli Zaretskii 2021-10-04 17:41 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-10-03 18:00 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Sun, 03 Oct 2021 20:42:56 +0300 > > It solves the problem because tab-line-close-highlight doesn't inherit > from other faces. It's face inheritance that caused the problem > with vertical movement of the button. I'd still like to understand why this happens. It sounds like a bug. You said you found some coordinates miscalculated, but didn't provide any details. Could you please provide those details, so I could try to look at that? Debugging this is notoriously hard, because the code is entered upon almost every mouse movement, so it is important for me to know which code I'm investigating to be able to set up the breakpoint conditions that avoid triggering at non-interesting moments. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-03 18:00 ` Eli Zaretskii @ 2021-10-04 17:41 ` Juri Linkov 2021-10-04 17:52 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-10-04 17:41 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 >> It solves the problem because tab-line-close-highlight doesn't inherit >> from other faces. It's face inheritance that caused the problem >> with vertical movement of the button. > > I'd still like to understand why this happens. It sounds like a bug. > > You said you found some coordinates miscalculated, but didn't provide > any details. Could you please provide those details, so I could try > to look at that? Debugging this is notoriously hard, because the code > is entered upon almost every mouse movement, so it is important for me > to know which code I'm investigating to be able to set up the > breakpoint conditions that avoid triggering at non-interesting > moments. I don't understand how coordinates are calculated, so I'll try to create a minimal test case for debugging. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-04 17:41 ` Juri Linkov @ 2021-10-04 17:52 ` Eli Zaretskii 2021-10-06 7:16 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-10-04 17:52 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Mon, 04 Oct 2021 20:41:09 +0300 > > >> It solves the problem because tab-line-close-highlight doesn't inherit > >> from other faces. It's face inheritance that caused the problem > >> with vertical movement of the button. > > > > I'd still like to understand why this happens. It sounds like a bug. > > > > You said you found some coordinates miscalculated, but didn't provide > > any details. Could you please provide those details, so I could try > > to look at that? Debugging this is notoriously hard, because the code > > is entered upon almost every mouse movement, so it is important for me > > to know which code I'm investigating to be able to set up the > > breakpoint conditions that avoid triggering at non-interesting > > moments. > > I don't understand how coordinates are calculated, > so I'll try to create a minimal test case for debugging. Thanks. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-04 17:52 ` Eli Zaretskii @ 2021-10-06 7:16 ` Juri Linkov 2021-10-07 10:13 ` Eli Zaretskii 0 siblings, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-10-06 7:16 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 >> I don't understand how coordinates are calculated, >> so I'll try to create a minimal test case for debugging. > > Thanks. It seems this test case exposes the problem. The face 'test-highlight' just inherits from 'test-tab', but hovering over the image shifts it upwards outside of the view. The test uses the header-line to show that the problem is the same for both the tab-line and the header-line. (defface test '((t :height 2.0)) "") (defface test-tab '((default :inherit test) (t :box (:line-width 1 :style released-button))) "") (defface test-highlight '((default :inherit test-tab)) "") (setq header-line-format (list (propertize " + " 'display '(image :type xpm :file "tabs/new.xpm" :margin (2 . 0) :ascent center) 'face 'test-tab 'mouse-face 'test-highlight))) ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-06 7:16 ` Juri Linkov @ 2021-10-07 10:13 ` Eli Zaretskii 2021-10-07 12:52 ` Eli Zaretskii 2021-10-10 17:04 ` Juri Linkov 0 siblings, 2 replies; 29+ messages in thread From: Eli Zaretskii @ 2021-10-07 10:13 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Wed, 06 Oct 2021 10:16:27 +0300 > > It seems this test case exposes the problem. > The face 'test-highlight' just inherits from 'test-tab', > but hovering over the image shifts it upwards outside of the view. > The test uses the header-line to show that the problem is the same > for both the tab-line and the header-line. > > (defface test > '((t :height 2.0)) > "") > > (defface test-tab > '((default :inherit test) > (t :box (:line-width 1 :style released-button))) > "") > > (defface test-highlight > '((default :inherit test-tab)) > "") > > (setq header-line-format > (list (propertize " + " > 'display '(image :type xpm > :file "tabs/new.xpm" > :margin (2 . 0) > :ascent center) > 'face 'test-tab > 'mouse-face 'test-highlight))) Thanks, but I'm not sure I understand what you expected and why. the face 'test' is defined to be twice the width of the default face. The face test-highlight inherits from it, but the 't' case doesn't change the :height attribute, so it ends up having the same height, just with the :box attribute. That's why it looks bad on the header line: its height is greater than that of header-line. What did you expect to happen with these definitions of faces? ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-07 10:13 ` Eli Zaretskii @ 2021-10-07 12:52 ` Eli Zaretskii 2021-10-10 17:04 ` Juri Linkov 1 sibling, 0 replies; 29+ messages in thread From: Eli Zaretskii @ 2021-10-07 12:52 UTC (permalink / raw) To: juri; +Cc: luangruo, larsi, 50798 > Date: Thu, 07 Oct 2021 13:13:37 +0300 > From: Eli Zaretskii <eliz@gnu.org> > Cc: luangruo@yahoo.com, larsi@gnus.org, 50798@debbugs.gnu.org > > The face 'test' is defined to be twice the width of the default > face. ^^^^^ Sorry, that was supposed to be "height", of course. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-07 10:13 ` Eli Zaretskii 2021-10-07 12:52 ` Eli Zaretskii @ 2021-10-10 17:04 ` Juri Linkov 2021-10-10 17:58 ` Eli Zaretskii 1 sibling, 1 reply; 29+ messages in thread From: Juri Linkov @ 2021-10-10 17:04 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 >> (defface test >> '((t :height 2.0)) >> "") >> >> (defface test-tab >> '((default :inherit test) >> (t :box (:line-width 1 :style released-button))) >> "") >> >> (defface test-highlight >> '((default :inherit test-tab)) >> "") > > Thanks, but I'm not sure I understand what you expected and why. the > face 'test' is defined to be twice the width of the default face. The > face test-highlight inherits from it, but the 't' case doesn't change > the :height attribute, so it ends up having the same height, just with > the :box attribute. That's why it looks bad on the header line: its > height is greater than that of header-line. > > What did you expect to happen with these definitions of faces? My previous patch avoided inheriting from the face that changes the height of the mouse-highlight face. Maybe it was the right solution? ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-10 17:04 ` Juri Linkov @ 2021-10-10 17:58 ` Eli Zaretskii 2021-10-11 18:28 ` Juri Linkov 0 siblings, 1 reply; 29+ messages in thread From: Eli Zaretskii @ 2021-10-10 17:58 UTC (permalink / raw) To: Juri Linkov; +Cc: luangruo, larsi, 50798 > From: Juri Linkov <juri@linkov.net> > Cc: larsi@gnus.org, luangruo@yahoo.com, 50798@debbugs.gnu.org > Date: Sun, 10 Oct 2021 20:04:05 +0300 > > >> (defface test > >> '((t :height 2.0)) > >> "") > >> > >> (defface test-tab > >> '((default :inherit test) > >> (t :box (:line-width 1 :style released-button))) > >> "") > >> > >> (defface test-highlight > >> '((default :inherit test-tab)) > >> "") > > > > Thanks, but I'm not sure I understand what you expected and why. the > > face 'test' is defined to be twice the width of the default face. The > > face test-highlight inherits from it, but the 't' case doesn't change > > the :height attribute, so it ends up having the same height, just with > > the :box attribute. That's why it looks bad on the header line: its > > height is greater than that of header-line. > > > > What did you expect to happen with these definitions of faces? > > My previous patch avoided inheriting from the face that changes the > height of the mouse-highlight face. Maybe it was the right solution? Did you intend that the face which inherited will NOT have the changed size like the one it inherited from? If so, not inheriting is probably the easiest solution. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-10-10 17:58 ` Eli Zaretskii @ 2021-10-11 18:28 ` Juri Linkov 0 siblings, 0 replies; 29+ messages in thread From: Juri Linkov @ 2021-10-11 18:28 UTC (permalink / raw) To: Eli Zaretskii; +Cc: luangruo, larsi, 50798 close 50798 28.0.60 quit >> >> (defface test >> >> '((t :height 2.0)) >> >> "") >> >> >> >> (defface test-highlight >> >> '((default :inherit test-tab)) >> >> "") >> > >> > What did you expect to happen with these definitions of faces? >> >> My previous patch avoided inheriting from the face that changes the >> height of the mouse-highlight face. Maybe it was the right solution? > > Did you intend that the face which inherited will NOT have the changed > size like the one it inherited from? If so, not inheriting is > probably the easiest solution. Yes, no need to change size on mouse highlighting, so I pushed this fix. One possible problem is that some themes might break. But I checked that modus-themes.el is well-designed, so its face inheritance doesn't break because its parent face doesn't use the face attribute :height: `(tab-line-highlight ((,class :inherit modus-themes-active-blue))) ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 8:22 ` Eli Zaretskii 2021-09-25 8:30 ` Lars Ingebrigtsen @ 2021-09-25 8:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 1 sibling, 0 replies; 29+ messages in thread From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2021-09-25 8:30 UTC (permalink / raw) To: Eli Zaretskii; +Cc: Lars Ingebrigtsen, 50798 Eli Zaretskii <eliz@gnu.org> writes: > 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. If it helps, I'm using Source Code Pro-13 as the font for tab lines. Thanks. ^ permalink raw reply [flat|nested] 29+ messages in thread
* bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse 2021-09-25 6:54 ` bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-09-25 7:17 ` Lars Ingebrigtsen @ 2021-09-25 7:59 ` Eli Zaretskii 1 sibling, 0 replies; 29+ messages in thread From: Eli Zaretskii @ 2021-09-25 7:59 UTC (permalink / raw) To: Po Lu; +Cc: 50798 > Date: Sat, 25 Sep 2021 14:54:31 +0800 > From: Po Lu via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> > > > The close button for each tab in a tab line is off-center unless it's > under mouse face. It probably has something to do with how the image spec in tab-line-close-button is defined, specifically the margin and ascent attributes. ^ permalink raw reply [flat|nested] 29+ messages in thread
end of thread, other threads:[~2021-10-11 18:28 UTC | newest] Thread overview: 29+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <8735ptxhzs.fsf.ref@yahoo.com> 2021-09-25 6:54 ` bug#50798: 28.0.50; Tab line close button is off-center until it is highlighted with the mouse Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-09-25 7:17 ` Lars Ingebrigtsen 2021-09-25 8:00 ` Eli Zaretskii 2021-09-25 8:19 ` Lars Ingebrigtsen 2021-09-25 8:22 ` Eli Zaretskii 2021-09-25 8:30 ` Lars Ingebrigtsen 2021-09-25 18:53 ` Juri Linkov 2021-09-25 19:44 ` Eli Zaretskii 2021-09-26 5:33 ` Lars Ingebrigtsen 2021-09-27 15:39 ` Juri Linkov 2021-09-27 18:40 ` Eli Zaretskii 2021-09-28 18:46 ` Juri Linkov 2021-10-02 10:08 ` Eli Zaretskii 2021-10-02 19:36 ` Juri Linkov 2021-10-03 11:49 ` Eli Zaretskii 2021-10-03 16:51 ` Juri Linkov 2021-10-03 17:22 ` Eli Zaretskii 2021-10-03 17:42 ` Juri Linkov 2021-10-03 18:00 ` Eli Zaretskii 2021-10-04 17:41 ` Juri Linkov 2021-10-04 17:52 ` Eli Zaretskii 2021-10-06 7:16 ` Juri Linkov 2021-10-07 10:13 ` Eli Zaretskii 2021-10-07 12:52 ` Eli Zaretskii 2021-10-10 17:04 ` Juri Linkov 2021-10-10 17:58 ` Eli Zaretskii 2021-10-11 18:28 ` Juri Linkov 2021-09-25 8:30 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors 2021-09-25 7:59 ` Eli Zaretskii
Code repositories for project(s) associated with this external index https://git.savannah.gnu.org/cgit/emacs.git https://git.savannah.gnu.org/cgit/emacs/org-mode.git This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.