ghostty icon indicating copy to clipboard operation
ghostty copied to clipboard

gtk: add option to always display the tab bar

Open pluiedev opened this issue 11 months ago • 11 comments

Also fixes crashes in both vanilla GTK and Adwaita implementations of closeTab, which erroneously close windows twice when there are no more tabs left (we probably already handle it somewhere else).

pluiedev avatar Feb 05 '25 13:02 pluiedev

Why would you want to have it as never... 🤦‍♀️ Though I guess it's not that hard to implement

pluiedev avatar Feb 05 '25 23:02 pluiedev

So I've been thinking about this for a while, and I think it might be worthwhile to reorganize the config options pertaining to tab bars:

  • window-tab-bar = auto, always, none

    • auto is behavior we have right now, and none has roughly the same effect as gtk-tabs-location=hidden, but the tab bar is merely hidden instead of not being attached
  • window-tab-bar-position = top, bottom, (left, right?)

    • AFAICT macOS currently only supports top due to native tabbing limitations, but bottom could be supported when we move to a custom tabbing solution. left and right aren't included by default as it's not a design that libadwaita supports natively, but we could devise a hack later using something like AdwOverlaySplitView with the sidebar always visible.
  • Remove gtk-tabs-location and supersede it with the above two options

pluiedev avatar Feb 10 '25 17:02 pluiedev

Why would you want to have it as never... 🤦‍♀️ Though I guess it's not that hard to implement

I can answer that. I prefer either slim tabs or none if it's drawn by libadwaita. My personal issue with libadwaita is the vertical space it requires for tabs (CSD and SSD), and that it doesn't respect (prob can't) what I have otherwise configured as GTK theme. Another, hopefully temporary, reason is that if tabs are always hidden (or always shown), it would remove a second cause of stretching other than using a tiling compositor.

lcgix0 avatar Feb 10 '25 21:02 lcgix0

My personal issue with libadwaita is the vertical space it requires for tabs (CSD and SSD), and that it doesn't respect (prob can't) what I have otherwise configured as GTK theme.

Note you can also attempt to slim them down using our gtk-custom-css configuration option. I haven't verified if its possible or how easy it is, but on paper it should be possible.

mitchellh avatar Feb 11 '25 15:02 mitchellh

I'm still not sure about the never case as it does basically the same (or even exactly the same when libadwaita is disabled) thing as gtk-tabs-location=hidden... Though I'm fine with only merging the always option

pluiedev avatar Feb 11 '25 17:02 pluiedev

I'm still not sure about the never case as it does basically the same (or even exactly the same when libadwaita is disabled) thing

Isn't libadwaita going to be hard dependency in the future? That's what I remember from the release notes. It's why I re-enabled it in my 1.1.0 build.

lcgix0 avatar Feb 11 '25 18:02 lcgix0

Yeah - the difference is that on libadwaita gtk-tabs-location=hidden we display the number of tabs in a tab button, whereas window-tab-bar=never doesn't. I find that kinda silly...

pluiedev avatar Feb 11 '25 19:02 pluiedev

@pluiedev Hi, could you please rebase this PR?

chenzhiwei avatar Mar 13 '25 07:03 chenzhiwei

Rebased and replaced gtk-tabs-location=hidden with window-show-tab-bar=never. This is obviously a breaking change but we can add a migration mechanism in a different PR

pluiedev avatar Mar 14 '25 11:03 pluiedev

aha, conflicts again.

chenzhiwei avatar Mar 19 '25 09:03 chenzhiwei

@mitchellh could you take a look at this long waited feature?

chenzhiwei avatar Jun 10 '25 01:06 chenzhiwei

Rebased and replaced gtk-tabs-location=hidden with window-show-tab-bar=never. This is obviously a breaking change but we can add a migration mechanism in a different PR

found why it broke my config haha

Ev357 avatar Jun 27 '25 22:06 Ev357

Oh good catch.

mitchellh avatar Jun 27 '25 22:06 mitchellh

Made #7706 to track that.

mitchellh avatar Jun 27 '25 22:06 mitchellh