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

From: Eli Zaretskii <[email-masked]>
Date: Fri, 11 Oct 2019 10:16:20 +0300

> From: Juri Linkov <[email-masked]>
> Cc: [email-masked]
> Date: Fri, 11 Oct 2019 01:25:32 +0300
> 
> >   C-x 6 f xdisp.c RET
> >   C-x 6 f dispnew.c RET
> >   C-x 6 f dispextern.h RET
> >   C-x 6 f window.c RET
> >   C-x 6 f frame.c RET
> >
> > The 6th button is displayed partially on the 1st tab-bar line, and the
> > rest on the 2nd line, which I don't think is pretty.
> >
> > If you do the same in a -nw session, the 6th tab will not be visible
> > at all (it looks like display_tab_bar assumes there's always just one
> > tab-bar line?).
> 
> What are the possible options?
> 
> 1. Use something like word-wrap in the tab-bar to wrap
>    to the second line non-broken tabs at tab boundaries;

Yes, that's a possibility and shouldn't be hard to implement.

> 2. Disable wrapping to the second line since it's not supported in -nw;

Why isn't it supported on TTY frames, btw?  It seemed to me that the
infrastructure is there, i.e. we can have FRAME_TAB_BAR_LINES(f) > 1,
it's just that the code doesn't consider this possibility.

> 3. Then truncate tab names to fit all tabs into the first line;

This is not scalable.

> 4. Or don't truncate but allow scrolling tabs with mouse wheel;

Yes, this could work as well (but scrolling should be possible not
only with the mouse).  The implementation could simply hscroll the
tab-bar window, including automatic hscrolling when the current tab is
far from the leftmost one.  Maybe this alternative is the easiest
one.  The only difficulty here is with TTY frames.

Thanks.