From 6cd7b5b05ee32be426d7e010b0c56603d0e228c8 Mon Sep 17 00:00:00 2001 From: Jack Jamison Date: Sat, 18 Oct 2025 13:16:02 -0400 Subject: center option --- layer_surface.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'layer_surface.c') diff --git a/layer_surface.c b/layer_surface.c index 936e1ab..bf17d45 100644 --- a/layer_surface.c +++ b/layer_surface.c @@ -8,16 +8,18 @@ void create_surface(client_state* state) { uint32_t anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT; - if (state->lines > 0) { + if (state->center) { anchor |= ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; } // figure out size uint32_t desired_width = 0; uint32_t desired_height = state->line_height; + if (state->center) { + desired_width = MAX(state->required_width, min_width); + } if (state->lines > 0) { desired_height = (state->lines + 1) * state->line_height; - desired_width = MAX(state->required_width, min_width); } // create surface -- cgit v1.2.3