aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar mwenzkowski <29407878+mwenzkowski@users.noreply.github.com>2019-04-16 21:20:48 +0200
committerLibravatar Brian Ashworth <bosrsf04@gmail.com>2019-04-16 17:05:49 -0400
commit9ac2342a673e899af87b8f8406820f2cc40bb185 (patch)
tree729b8e782b31ba58d9c02cee69e6df6c38693b15
parentview.c: refactor view_autoconfigure() (diff)
downloadsway-9ac2342a673e899af87b8f8406820f2cc40bb185.tar.gz
sway-9ac2342a673e899af87b8f8406820f2cc40bb185.tar.zst
sway-9ac2342a673e899af87b8f8406820f2cc40bb185.zip
Don't apply hide_edge_borders to floating windows
This change matches i3's behavior.
-rw-r--r--sway/tree/view.c36
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