Subject: bug#37667: 27.0.50; Tab Bar display problems with more than 5 tabs

From: Juri Linkov <[email-masked]>
Date: Wed, 16 Oct 2019 01:39:39 +0300

>> > I have one question: why menu-bar wrapping was not implemented on
>> > TTY frames so far, why the design decision was to always truncate it?
>> 
>> Most probably because the number of items on the menu bar is usually
>> small, unlike the number of tabs that can grow very large.
>
> Also, the menu bar on TTY frames originally was just a decoration: you
> couldn't do anything with it except look.  So it made little sense to
> invest in wrapping that line.  Drop-down menus on TTY frames are a
> relatively recent addition, since Emacs 24.4.

I've started with implementing hscrolling for window tab-line
because this is needed for both graphical displays and TTY.

But the first question popped up quickly: I don't understand
how to detect the situation where the tab-line is truncated?
And how to find the tab that is visible partially?
Especially when the font is variable-pitch.

What I'm trying to do is to hide leftmost tabs one by one until
the current tab on the rightmost side becomes completely visible.
Please advise.