summaryrefslogtreecommitdiff
path: root/sway/desktop/render.c
diff options
context:
space:
mode:
authorrti <[email protected]>2023-01-19 23:33:56 +0100
committerGitHub <[email protected]>2023-01-19 17:33:56 -0500
commit9e6901264b2d93d0ab0b91aee20a3d543f53d0ec (patch)
tree12a587ec22a820272249624fe066b12e461a5675 /sway/desktop/render.c
parentdbe2be6a363a9db2bacf96447badf3d04ece4587 (diff)
feat: smart smart_corner_radius (#101)
Diffstat (limited to 'sway/desktop/render.c')
-rw-r--r--sway/desktop/render.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/desktop/render.c b/sway/desktop/render.c
index 81a965b9..1ecada45 100644
--- a/sway/desktop/render.c
+++ b/sway/desktop/render.c
@@ -1003,6 +1003,9 @@ static void render_containers_linear(struct sway_output *output,
}
bool has_titlebar = state->border == B_NORMAL;
+ int corner_radius = config->smart_corner_radius &&
+ output->current.active_workspace->current_gaps.top == 0
+ ? 0 : child->corner_radius;
struct decoration_data deco_data = {
.alpha = child->alpha,
.dim_color = view_is_urgent(view)
@@ -1010,8 +1013,7 @@ static void render_containers_linear(struct sway_output *output,
: config->dim_inactive_colors.unfocused,
.dim = child->current.focused || parent->focused ? 0.0f: config->dim_inactive,
// no corner radius if no gaps (allows smart_gaps to work as expected)
- .corner_radius = output->current.active_workspace->current_gaps.top == 0
- ? 0 : child->corner_radius,
+ .corner_radius = corner_radius,
.saturation = child->saturation,
.has_titlebar = has_titlebar,
};