diff --git a/output.c b/output.c index 0577c0d..e937bc7 100644 --- a/output.c +++ b/output.c @@ -1,7 +1,7 @@ /* * Cage: A Wayland kiosk. * - * Copyright (C) 2018-2020 Jente Hidskes + * Copyright (C) 2018-2021 Jente Hidskes * Copyright (C) 2019 The Sway authors * * See the LICENSE file accompanying this file. @@ -230,6 +230,10 @@ handle_new_output(struct wl_listener *listener, void *data) } } + for (size_t i = 0; i < sizeof(output->layers) / sizeof(output->layers[0]); i++) { + wl_list_init(&output->layers[i]); + } + if (!wlr_xcursor_manager_load(server->seat->xcursor_manager, wlr_output->scale)) { wlr_log(WLR_ERROR, "Cannot load XCursor theme for output '%s' with scale %f", wlr_output->name, wlr_output->scale); diff --git a/output.h b/output.h index ced06f6..ffd349c 100644 --- a/output.h +++ b/output.h @@ -8,6 +8,14 @@ #include "server.h" #include "view.h" +/* There exist currently four layers: + * - ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND + * - ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM + * - ZWLR_LAYER_SHELL_V1_LAYER_TOP + * - ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY + */ +#define NUM_LAYERS 4 + struct cg_output { struct cg_server *server; struct wlr_output *wlr_output; @@ -19,6 +27,7 @@ struct cg_output { struct wl_listener frame; struct wl_list link; // cg_server::outputs + struct wl_list layers[NUM_LAYERS]; // cg_layer_surface::link }; void handle_new_output(struct wl_listener *listener, void *data);