config: add show-titles auto option
Covers #678, but simpler than the original proposal there. Opted to change show-titles instead of going with window rules and new simple actions.
It just adds a new auto option that shows titles if there's more than 1 window in a container or if the window is floating. Intentionally didn't want to complicate it by counting windows on workspace (in a container + any floating) because that seemed too complicated for no value.
~Toggle action rotates between show-titles options. Wasn't sure about it, I guess it could also skip auto.~
Also fixes an obscure crash when borders are larger than the window after border-width gets changed dynamically (changing config and reloading) and covers that with an integration test.
Maybe more importantly, do you think this makes sense at all or would a window rule + new simple action approach make more sense?
That would've been less messy in terms of maintaining config shared lib compatibility at least and would probably accomplish most of what this is trying to do.
I'll give it a shot with the window rule approach and see how that looks. Maybe it would end up nicer in terms of implementation while still covering the features needed.
Maybe instead of having the ShowTitles enum this should instead be a separate boolean that determines if titles are automatically hidden in some circumstances.
Maybe instead of having the ShowTitles enum this should instead be a separate boolean that determines if titles are automatically hidden in some circumstances.
Let's pause this one, I already marked it as draft earlier. I agree about the _v2 naming being messy along with quite a few other things as well.
I'll explore a simple action + window rule solution a bit and we'll se if that's a better approach to pursue. It also has a couple of non-trivial problems to solve, but my thinking so far is that it would be cleaner.
I'll close and park this idea for now.
I have a working version with actions for show-title, hide-title, toggle-title, but that also had quite a bit more complexity than I expected.
That's even after I decided I'm intentionally not going to handle the mono mode container case and the fact that windows with title visibility overriden with one of these actions can't be reset back to global show-titles setting.
There was a lot of extra logic for handling dragging drop zones being different if there's now windows of different title height (some shown, some hidden) and couple of other complexities.
I've ran it for a while and it seemed fine, but I don't feel like the complexity (even without covering some of the edge cases) is worth it for what seems like a very personal gripe.
FWIW I got used to running Jay with show-titles = false and haven't had any trouble.
Thanks for talking this through with me, it was a good learning experience trying the 2 approaches. :slightly_smiling_face: