diff options
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r-- | sway/desktop/render.c | 108 |
1 files changed, 51 insertions, 57 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index af4e2905..c8b08a58 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -272,7 +272,7 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, render_view_toplevels(view, output, damage, view->container->alpha); } - if (view->container->current.using_csd) { + if (con->current.border == B_NONE || con->current.border == B_CSD) { return; } @@ -281,51 +281,49 @@ static void render_view(struct sway_output *output, pixman_region32_t *damage, float color[4]; struct sway_container_state *state = &con->current; - if (state->border != B_NONE) { - if (state->border_left) { - memcpy(&color, colors->child_border, sizeof(float) * 4); - premultiply_alpha(color, con->alpha); - box.x = state->con_x; - box.y = state->view_y; - box.width = state->border_thickness; - box.height = state->view_height; - scale_box(&box, output_scale); - render_rect(output->wlr_output, damage, &box, color); - } + if (state->border_left) { + memcpy(&color, colors->child_border, sizeof(float) * 4); + premultiply_alpha(color, con->alpha); + box.x = state->con_x; + box.y = state->view_y; + box.width = state->border_thickness; + box.height = state->view_height; + scale_box(&box, output_scale); + render_rect(output->wlr_output, damage, &box, color); + } - list_t *siblings = container_get_current_siblings(con); - enum sway_container_layout layout = - container_current_parent_layout(con); + list_t *siblings = container_get_current_siblings(con); + enum sway_container_layout layout = + container_current_parent_layout(con); - if (state->border_right) { - if (siblings->length == 1 && layout == L_HORIZ) { - memcpy(&color, colors->indicator, sizeof(float) * 4); - } else { - memcpy(&color, colors->child_border, sizeof(float) * 4); - } - premultiply_alpha(color, con->alpha); - box.x = state->view_x + state->view_width; - box.y = state->view_y; - box.width = state->border_thickness; - box.height = state->view_height; - scale_box(&box, output_scale); - render_rect(output->wlr_output, damage, &box, color); + if (state->border_right) { + if (siblings->length == 1 && layout == L_HORIZ) { + memcpy(&color, colors->indicator, sizeof(float) * 4); + } else { + memcpy(&color, colors->child_border, sizeof(float) * 4); } + premultiply_alpha(color, con->alpha); + box.x = state->view_x + state->view_width; + box.y = state->view_y; + box.width = state->border_thickness; + box.height = state->view_height; + scale_box(&box, output_scale); + render_rect(output->wlr_output, damage, &box, color); + } - if (state->border_bottom) { - if (siblings->length == 1 && layout == L_VERT) { - memcpy(&color, colors->indicator, sizeof(float) * 4); - } else { - memcpy(&color, colors->child_border, sizeof(float) * 4); - } - premultiply_alpha(color, con->alpha); - box.x = state->con_x; - box.y = state->view_y + state->view_height; - box.width = state->con_width; - box.height = state->border_thickness; - scale_box(&box, output_scale); - render_rect(output->wlr_output, damage, &box, color); + if (state->border_bottom) { + if (siblings->length == 1 && layout == L_VERT) { + memcpy(&color, colors->indicator, sizeof(float) * 4); + } else { + memcpy(&color, colors->child_border, sizeof(float) * 4); } + premultiply_alpha(color, con->alpha); + box.x = state->con_x; + box.y = state->view_y + state->view_height; + box.width = state->con_width; + box.height = state->border_thickness; + scale_box(&box, output_scale); + render_rect(output->wlr_output, damage, &box, color); } } @@ -645,14 +643,12 @@ static void render_containers_linear(struct sway_output *output, marks_texture = view->marks_unfocused; } - if (!view->container->current.using_csd) { - if (state->border == B_NORMAL) { - render_titlebar(output, damage, child, state->con_x, - state->con_y, state->con_width, colors, - title_texture, marks_texture); - } else { - render_top_border(output, damage, child, colors); - } + if (state->border == B_NORMAL) { + render_titlebar(output, damage, child, state->con_x, + state->con_y, state->con_width, colors, + title_texture, marks_texture); + } else if (state->border == B_PIXEL) { + render_top_border(output, damage, child, colors); } render_view(output, damage, child, colors); } else { @@ -859,14 +855,12 @@ static void render_floating_container(struct sway_output *soutput, marks_texture = view->marks_unfocused; } - if (!view->container->current.using_csd) { - if (con->current.border == B_NORMAL) { - render_titlebar(soutput, damage, con, con->current.con_x, - con->current.con_y, con->current.con_width, colors, - title_texture, marks_texture); - } else if (con->current.border != B_NONE) { - render_top_border(soutput, damage, con, colors); - } + if (con->current.border == B_NORMAL) { + render_titlebar(soutput, damage, con, con->current.con_x, + con->current.con_y, con->current.con_width, colors, + title_texture, marks_texture); + } else if (con->current.border == B_PIXEL) { + render_top_border(soutput, damage, con, colors); } render_view(soutput, damage, con, colors); } else { |