@@ 157,7 157,6 @@ static const struct wl_seat_listener seat_listener = {
static void handle_global(void *data, struct wl_registry *registry,
uint32_t name, const char *interface, uint32_t version) {
- (void)version;
struct context *ctx = data;
if (strcmp(interface, wl_seat_interface.name) == 0) {
ctx->seat = wl_registry_bind(registry, name, &wl_seat_interface, 1);
@@ 168,8 167,8 @@ static void handle_global(void *data, struct wl_registry *registry,
} else if (strcmp(interface, xdg_wm_base_interface.name) == 0) {
ctx->xdg_wm_base =
wl_registry_bind(registry, name, &xdg_wm_base_interface, 1);
- } else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0) {
- ctx->layer_shell = wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, 1);
+ } else if (strcmp(interface, zwlr_layer_shell_v1_interface.name) == 0 && version >= 2) {
+ ctx->layer_shell = wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, 2);
}
}
@@ 515,6 514,7 @@ int main(int argc, char **argv) {
}
zwlr_layer_surface_v1_set_anchor(ctx.layer_surface, anchor);
zwlr_layer_surface_v1_set_exclusive_zone(ctx.layer_surface, bar_width);
+ zwlr_layer_surface_v1_set_layer(ctx.layer_surface, ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM);
zwlr_layer_surface_v1_add_listener(ctx.layer_surface, &layer_surface_listener, &ctx);
}