layers: only define LAB_NR_LAYERS locally where needed

This commit is contained in:
Johan Malm 2022-03-02 20:39:46 +00:00
parent 98d5fd483d
commit d3918eec0a
4 changed files with 8 additions and 6 deletions

View file

@ -111,7 +111,8 @@ new_output_notify(struct wl_listener *listener, void *data)
output->frame.notify = output_frame_notify;
wl_signal_add(&wlr_output->events.frame, &output->frame);
for (int i = 0; i < LAB_NR_LAYERS; i++) {
int nr_layers = sizeof(output->layers) / sizeof(output->layers[0]);
for (int i = 0; i < nr_layers; i++) {
wl_list_init(&output->layers[i]);
output->layer_tree[i] =
wlr_scene_tree_create(&server->scene->node);