From 73c62e97979df803e07f7a3d9c7296e162700339 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Sun, 3 Feb 2019 17:45:26 +0100 Subject: [PATCH] bar/wayland: cleanup --- bar/bar.c | 3 +-- bar/wayland.c | 17 ++++++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bar/bar.c b/bar/bar.c index 6fffeed..dc0b5bd 100644 --- a/bar/bar.c +++ b/bar/bar.c @@ -380,9 +380,8 @@ bar_new(const struct bar_config *config) priv->left.count = config->left.count; priv->center.count = config->center.count; priv->right.count = config->right.count; - //priv->cursor_ctx = NULL; - //priv->cursor = 0; priv->cursor_name = NULL; + #if 0 priv->backend.data = bar_backend_xcb_new(); priv->backend.iface = &xcb_backend_iface; diff --git a/bar/wayland.c b/bar/wayland.c index 37cb594..a56f186 100644 --- a/bar/wayland.c +++ b/bar/wayland.c @@ -525,17 +525,20 @@ setup(struct bar *_bar) assert(backend->layer_surface != NULL); /* Aligned to top, maximum width */ + enum zwlr_layer_surface_v1_anchor top_or_bottom = bar->location == BAR_TOP + ? ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP + : ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; + zwlr_layer_surface_v1_set_anchor( backend->layer_surface, ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT | - ((bar->location == BAR_TOP) - ? ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP - : ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM) - ); + top_or_bottom); - zwlr_layer_surface_v1_set_size(backend->layer_surface, 0, bar->height_with_border); - zwlr_layer_surface_v1_set_exclusive_zone(backend->layer_surface, bar->height_with_border); + zwlr_layer_surface_v1_set_size( + backend->layer_surface, 0, bar->height_with_border); + zwlr_layer_surface_v1_set_exclusive_zone( + backend->layer_surface, bar->height_with_border); //zwlr_layer_surface_v1_set_margin( // layer_surface, margin_top, margin_right, margin_bottom, margin_left); @@ -545,7 +548,7 @@ setup(struct bar *_bar) zwlr_layer_surface_v1_add_listener( backend->layer_surface, &layer_surface_listener, backend); - /* Assign width/height */ + /* Trigger a 'configure' event, after which we'll have the width */ wl_surface_commit(backend->surface); wl_display_roundtrip(backend->display);