swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.58k stars 1.11k forks source link

hide_edge_borders doesn't hide the title bar #4132

Closed alecmev closed 5 years ago

alecmev commented 5 years ago

Neither of these four hide the title bar of a fresh lone window on a fresh workspace:

hide_edge_borders both
hide_edge_borders smart
hide_edge_borders --i3 both
hide_edge_borders --i3 smart

It's my understanding that they should, even though the docs don't mention it explicitly. For example, this issue says "titlebar is hidden" in the first step of "Current behavior", and this PR says "title bar is hidden" too. What am I doing wrong? Does this work for others? Is this maybe a master issue?

RedSoxFan commented 5 years ago

hide_edge_borders does not hide the title bars, just the border.

The confusion with the linked PR and issue stems from the behavior for tabbed and stacked containers and the following border modes: none and pixel. The following has no effect for border normal, which is the default. The two border modes hide title bars (and borders for the former) for split layouts. However, the titlebars are retained for tabbed and stacked layouts. If hide_edge_borders --i3 both|smart is given, the title bars will be hidden when there is only one child of the tabbed/stacked container (which matches i3's behavior). If hide_edge_borders both|smart is given, the title bar is retained even when there is only one child.

Since you do not appear to set default_border in your config (or have any for_window [<criteria>] border none|pixel) in your config, the views will have the normal border, which is never hidden

alecmev commented 5 years ago

Okay, thanks for the explanation, this makes sense.

To provide some context, I've been using default_border normal 0 for a long time, with a couple of for_window, and decided to see what it would feel like if all lone windows had no title bars. However, I'm now realizing that what I want is default_border none :slightly_smiling_face:

savchenko commented 2 years ago

After experimenting with hide_edge_borders it seems like @alecmev's conclusion is correct.

So, having the title hidden when there is only one window and showing it otherwise is impossible?..

@RedSoxFan , sorry for poking the old thread, but it is the most relevant one and I didn't want to flood the bug-tracker.

nnuel commented 2 years ago

After experimenting with hide_edge_borders it seems like @alecmev's conclusion is correct.

So, having the title hidden when there is only one window and showing it otherwise is impossible?..

@RedSoxFan , sorry for poking the old thread, but it is the most relevant one and I didn't want to flood the bug-tracker.

I also came across this issue. Would it be possible to manually program the wanted behaviour with a check on how many childs are shown on the window?

wjdp commented 1 year ago

I'm coming from i3 gaps which had this. Is there any way in sway to hide the title of a window if it's the only window in a workspace?

A manual workaround I've found for now is setting bindsym $mod+b border toggle and pressing this key to manually toggle the borders of window.

CyrilSLi commented 1 day ago

Check out https://github.com/CyrilSLi/linux-scripts (specifically detect_onlywindow.py) for an (imperfect) script I wrote and am using to solve this issue :)