Subject: bug#52986: 29.0.50; tab bar doesn't immediately show

From: martin rudalics <[email-masked]>
Date: Sun, 23 Jan 2022 11:15:49 +0100

> I think I'm also hitting this issue just by docking Emacs to the side in
 > GNOME Shell. I've set 'frame-inhibit-implied-resize' to t, but Emacs
 > still wants to resize the frame when initializing tab-bar-mode.

'frame-inhibit-implied-resize' defaults to '(tab-bar-lines) so you don't
even have to change its value.  What you see is the following: It's a
long established practice that people want their frames initially have
a specified number of lines, disregarding the height of things like the
tool or tab bar.  To do that, Emacs calculates the initial pixel height
of a GUI frame from the number of lines specified for it plus the pixel
heights of a tool and tab bar, if present.

Now the code that adds the latter ('x_change_tab_bar_height') uses two
boolean slots for each frame - tab_bar_resized and tab_bar_redisplayed -
both initially false.  The latter is set by the display engine in
redisplay_tab_bar to indicate that the tab bar has been redisplayed once
so its pixel height has been established.  The former is then set by
'x_change_tab_bar_height' from the latter.  As long as tab_bar_resized
has not been set for a specific frame, 'frame-inhibit-implied-resize'
has no effect - Emacs will ask the window manager to resize it.

 > I'm currently using Emacs 29.0.50 for the new GTK/Wayland support, and I
 > don't see the same issue on Emacs 28.0.91.

You should see it on Emacs 28.  Only if you start Emacs with tab bar
mode enabled initially you should not see it.

martin