diff options
-rw-r--r-- | sway/tree/view.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/sway/tree/view.c b/sway/tree/view.c index 40432661..e8f5a299 100644 --- a/sway/tree/view.c +++ b/sway/tree/view.c | |||
@@ -221,8 +221,10 @@ void view_autoconfigure(struct sway_view *view) { | |||
221 | 221 | ||
222 | con->border_top = con->border_bottom = true; | 222 | con->border_top = con->border_bottom = true; |
223 | con->border_left = con->border_right = true; | 223 | con->border_left = con->border_right = true; |
224 | double y_offset = 0; | ||
225 | |||
226 | if (!container_is_floating(con) && ws) { | ||
224 | 227 | ||
225 | if (ws) { | ||
226 | bool smart = config->hide_edge_borders == E_SMART || | 228 | bool smart = config->hide_edge_borders == E_SMART || |
227 | (config->hide_edge_borders == E_SMART_NO_GAPS && | 229 | (config->hide_edge_borders == E_SMART_NO_GAPS && |
228 | !gaps_to_edge(view)); | 230 | !gaps_to_edge(view)); |
@@ -240,24 +242,22 @@ void view_autoconfigure(struct sway_view *view) { | |||
240 | int bottom_y = con->y + con->height + con->current_gaps.bottom; | 242 | int bottom_y = con->y + con->height + con->current_gaps.bottom; |
241 | con->border_bottom = bottom_y != ws->y + ws->height; | 243 | con->border_bottom = bottom_y != ws->y + ws->height; |
242 | } | 244 | } |
243 | } | ||
244 | 245 | ||
245 | double y_offset = 0; | 246 | // In a tabbed or stacked container, the container's y is the top of the |
246 | 247 | // title area. We have to offset the surface y by the height of the title, | |
247 | // In a tabbed or stacked container, the container's y is the top of the | 248 | // bar, and disable any top border because we'll always have the title bar. |
248 | // title area. We have to offset the surface y by the height of the title, | 249 | list_t *siblings = container_get_siblings(con); |
249 | // bar, and disable any top border because we'll always have the title bar. | 250 | bool show_titlebar = (siblings && siblings->length > 1) |
250 | list_t *siblings = container_get_siblings(con); | 251 | || !config->hide_lone_tab; |
251 | bool show_titlebar = (siblings && siblings->length > 1) | 252 | if (show_titlebar) { |
252 | || !config->hide_lone_tab; | 253 | enum sway_container_layout layout = container_parent_layout(con); |
253 | if (show_titlebar && !container_is_floating(con)) { | 254 | if (layout == L_TABBED) { |
254 | enum sway_container_layout layout = container_parent_layout(con); | 255 | y_offset = container_titlebar_height(); |
255 | if (layout == L_TABBED) { | 256 | con->border_top = false; |
256 | y_offset = container_titlebar_height(); | 257 | } else if (layout == L_STACKED) { |
257 | con->border_top = false; | 258 | y_offset = container_titlebar_height() * siblings->length; |
258 | } else if (layout == L_STACKED) { | 259 | con->border_top = false; |
259 | y_offset = container_titlebar_height() * siblings->length; | 260 | } |
260 | con->border_top = false; | ||
261 | } | 261 | } |
262 | } | 262 | } |
263 | 263 | ||