mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-11-02 09:01:41 -05:00
output: Add struct members for layer shell
This commit is contained in:
parent
956b308d9e
commit
c82ec0585b
2 changed files with 30 additions and 12 deletions
24
output.c
24
output.c
|
|
@ -235,6 +235,11 @@ output_destroy(struct cg_output *output)
|
|||
wl_list_remove(&output->frame.link);
|
||||
wl_list_remove(&output->link);
|
||||
|
||||
wlr_scene_node_destroy(&output->layers.shell_background->node);
|
||||
wlr_scene_node_destroy(&output->layers.shell_bottom->node);
|
||||
wlr_scene_node_destroy(&output->layers.shell_top->node);
|
||||
wlr_scene_node_destroy(&output->layers.shell_overlay->node);
|
||||
|
||||
output_layout_remove(output);
|
||||
|
||||
free(output);
|
||||
|
|
@ -255,6 +260,18 @@ handle_output_destroy(struct wl_listener *listener, void *data)
|
|||
output_destroy(output);
|
||||
}
|
||||
|
||||
static struct wlr_scene_tree *
|
||||
create_layer_for_output(struct cg_output *output)
|
||||
{
|
||||
struct cg_server *server = output->server;
|
||||
struct wlr_scene_tree *layer = wlr_scene_tree_create(&server->scene->tree);
|
||||
if (layer == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
layer->node.data = output->wlr_output;
|
||||
return layer;
|
||||
}
|
||||
|
||||
void
|
||||
handle_new_output(struct wl_listener *listener, void *data)
|
||||
{
|
||||
|
|
@ -320,9 +337,10 @@ handle_new_output(struct wl_listener *listener, void *data)
|
|||
output_disable(next);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < sizeof(output->layers) / sizeof(output->layers[0]); i++) {
|
||||
wl_list_init(&output->layers[i]);
|
||||
}
|
||||
output->layers.shell_background = create_layer_for_output(output);
|
||||
output->layers.shell_bottom = create_layer_for_output(output);
|
||||
output->layers.shell_top = create_layer_for_output(output);
|
||||
output->layers.shell_overlay = create_layer_for_output(output);
|
||||
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue