aboutsummaryrefslogtreecommitdiff
path: root/layer_surface.c
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-10-18 13:16:02 -0400
committerJack Jamison <jackqjamison@gmail.com>2025-10-18 13:16:02 -0400
commit6cd7b5b05ee32be426d7e010b0c56603d0e228c8 (patch)
tree65b36bd6db774a63de7b86f4eadb647911478629 /layer_surface.c
parentacef4398df70b984ad6f2f403b2fa55c72219c73 (diff)
center option
Diffstat (limited to 'layer_surface.c')
-rw-r--r--layer_surface.c6
1 files changed, 4 insertions, 2 deletions
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