bar/wayland: cleanup

This commit is contained in:
Daniel Eklöf 2019-02-03 17:45:26 +01:00
parent 38c87ad165
commit 73c62e9797
2 changed files with 11 additions and 9 deletions

View file

@ -380,9 +380,8 @@ bar_new(const struct bar_config *config)
priv->left.count = config->left.count; priv->left.count = config->left.count;
priv->center.count = config->center.count; priv->center.count = config->center.count;
priv->right.count = config->right.count; priv->right.count = config->right.count;
//priv->cursor_ctx = NULL;
//priv->cursor = 0;
priv->cursor_name = NULL; priv->cursor_name = NULL;
#if 0 #if 0
priv->backend.data = bar_backend_xcb_new(); priv->backend.data = bar_backend_xcb_new();
priv->backend.iface = &xcb_backend_iface; priv->backend.iface = &xcb_backend_iface;

View file

@ -525,17 +525,20 @@ setup(struct bar *_bar)
assert(backend->layer_surface != NULL); assert(backend->layer_surface != NULL);
/* Aligned to top, maximum width */ /* 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( zwlr_layer_surface_v1_set_anchor(
backend->layer_surface, backend->layer_surface,
ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT | ZWLR_LAYER_SURFACE_V1_ANCHOR_LEFT |
ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT |
((bar->location == BAR_TOP) top_or_bottom);
? ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP
: ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM)
);
zwlr_layer_surface_v1_set_size(backend->layer_surface, 0, bar->height_with_border); zwlr_layer_surface_v1_set_size(
zwlr_layer_surface_v1_set_exclusive_zone(backend->layer_surface, bar->height_with_border); 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( //zwlr_layer_surface_v1_set_margin(
// layer_surface, margin_top, margin_right, margin_bottom, margin_left); // layer_surface, margin_top, margin_right, margin_bottom, margin_left);
@ -545,7 +548,7 @@ setup(struct bar *_bar)
zwlr_layer_surface_v1_add_listener( zwlr_layer_surface_v1_add_listener(
backend->layer_surface, &layer_surface_listener, backend); 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_surface_commit(backend->surface);
wl_display_roundtrip(backend->display); wl_display_roundtrip(backend->display);