diff --git a/include/sway/output.h b/include/sway/output.h index d72bf1b21..3ee4ca7ac 100644 --- a/include/sway/output.h +++ b/include/sway/output.h @@ -22,7 +22,7 @@ struct sway_output { struct sway_server *server; struct wl_list link; - struct wl_list layers[4]; // sway_layer_surface::link + struct wl_list shell_layers[4]; // sway_layer_surface::link struct wlr_box usable_area; struct timespec last_frame; diff --git a/sway/desktop/layer_shell.c b/sway/desktop/layer_shell.c index d44d6338e..7951192cc 100644 --- a/sway/desktop/layer_shell.c +++ b/sway/desktop/layer_shell.c @@ -182,13 +182,13 @@ void arrange_layers(struct sway_output *output) { &usable_area.width, &usable_area.height); // Arrange exclusive surfaces from top->bottom - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &usable_area, true); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &usable_area, true); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &usable_area, true); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &usable_area, true); if (memcmp(&usable_area, &output->usable_area, @@ -199,13 +199,13 @@ void arrange_layers(struct sway_output *output) { } // Arrange non-exclusive surfaces from top->bottom - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &usable_area, false); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &usable_area, false); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &usable_area, false); - arrange_layer(output, &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + arrange_layer(output, &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &usable_area, false); // Find topmost keyboard interactive layer, if such a layer exists @@ -217,7 +217,7 @@ void arrange_layers(struct sway_output *output) { struct sway_layer_surface *layer, *topmost = NULL; for (size_t i = 0; i < nlayers; ++i) { wl_list_for_each_reverse(layer, - &output->layers[layers_above_shell[i]], link) { + &output->shell_layers[layers_above_shell[i]], link) { if (layer->layer_surface->current.keyboard_interactive && layer->layer_surface->mapped) { topmost = layer; @@ -250,7 +250,7 @@ static struct sway_layer_surface *find_mapped_layer_by_client( // For now we'll only check the overlay layer struct sway_layer_surface *lsurface; wl_list_for_each(lsurface, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { struct wl_resource *resource = lsurface->layer_surface->resource; if (wl_resource_get_client(resource) == client && lsurface->layer_surface->mapped) { @@ -298,7 +298,7 @@ static void handle_surface_commit(struct wl_listener *listener, void *data) { layer_changed = layer->layer != layer_surface->current.layer; if (layer_changed) { wl_list_remove(&layer->link); - wl_list_insert(&output->layers[layer_surface->current.layer], + wl_list_insert(&output->shell_layers[layer_surface->current.layer], &layer->link); layer->layer = layer_surface->current.layer; } @@ -677,7 +677,7 @@ void handle_layer_shell_surface(struct wl_listener *listener, void *data) { sway_layer->output_destroy.notify = handle_output_destroy; wl_signal_add(&output->events.disable, &sway_layer->output_destroy); - wl_list_insert(&output->layers[layer_surface->pending.layer], + wl_list_insert(&output->shell_layers[layer_surface->pending.layer], &sway_layer->link); // Temporarily set the layer's current state to pending diff --git a/sway/desktop/output.c b/sway/desktop/output.c index 3f3f9494a..8962c0aef 100644 --- a/sway/desktop/output.c +++ b/sway/desktop/output.c @@ -334,10 +334,10 @@ static void output_for_each_surface(struct sway_output *output, #endif } else { output_layer_for_each_surface(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], iterator, user_data); output_layer_for_each_surface(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], iterator, user_data); workspace_for_each_container(workspace, @@ -348,13 +348,13 @@ static void output_for_each_surface(struct sway_output *output, iterator, user_data); #endif output_layer_for_each_surface(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], iterator, user_data); } overlay: output_layer_for_each_surface(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], iterator, user_data); output_drag_icons_for_each_surface(output, &root->drag_icons, iterator, user_data); @@ -386,7 +386,7 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) { bool output_has_opaque_overlay_layer_surface(struct sway_output *output) { struct sway_layer_surface *sway_layer_surface; wl_list_for_each(sway_layer_surface, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) { struct wlr_surface *wlr_surface = sway_layer_surface->layer_surface->surface; pixman_box32_t output_box = { .x2 = output->width, @@ -475,7 +475,7 @@ static bool scan_out_fullscreen_view(struct sway_output *output, } #endif - if (!wl_list_empty(&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY])) { + if (!wl_list_empty(&output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY])) { return false; } if (!wl_list_empty(&root->drag_icons)) { diff --git a/sway/desktop/render.c b/sway/desktop/render.c index ed9ad4906..4a398df78 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c @@ -1138,9 +1138,9 @@ void output_render(struct sway_output *output, struct timespec *when, } render_layer_toplevel(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); render_layer_toplevel(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); render_workspace(output, damage, workspace, workspace->current.focused); render_floating(output, damage); @@ -1148,14 +1148,14 @@ void output_render(struct sway_output *output, struct timespec *when, render_unmanaged(output, damage, &root->xwayland_unmanaged); #endif render_layer_toplevel(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); render_layer_popups(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); render_layer_popups(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); render_layer_popups(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); } render_seatops(output, damage); @@ -1168,9 +1168,9 @@ void output_render(struct sway_output *output, struct timespec *when, render_overlay: render_layer_toplevel(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); render_layer_popups(output, damage, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); render_drag_icons(output, damage, &root->drag_icons); renderer_end: diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 449aa4300..4a8efb0fb 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -99,7 +99,7 @@ struct sway_node *node_at_coords( // layer surfaces on the overlay layer are rendered on top if ((*surface = layer_surface_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], ox, oy, sx, sy))) { return NULL; } @@ -160,22 +160,22 @@ struct sway_node *node_at_coords( return NULL; } if ((*surface = layer_surface_popup_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], ox, oy, sx, sy))) { return NULL; } if ((*surface = layer_surface_popup_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], ox, oy, sx, sy))) { return NULL; } if ((*surface = layer_surface_popup_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], ox, oy, sx, sy))) { return NULL; } if ((*surface = layer_surface_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], ox, oy, sx, sy))) { return NULL; } @@ -186,12 +186,12 @@ struct sway_node *node_at_coords( } if ((*surface = layer_surface_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], ox, oy, sx, sy))) { return NULL; } if ((*surface = layer_surface_at(output, - &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], + &output->shell_layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], ox, oy, sx, sy))) { return NULL; } diff --git a/sway/tree/output.c b/sway/tree/output.c index b30e646e7..5a3fd8b6e 100644 --- a/sway/tree/output.c +++ b/sway/tree/output.c @@ -103,9 +103,9 @@ struct sway_output *output_create(struct wlr_output *wlr_output) { output->workspaces = create_list(); output->current.workspaces = create_list(); - size_t len = sizeof(output->layers) / sizeof(output->layers[0]); + size_t len = sizeof(output->shell_layers) / sizeof(output->shell_layers[0]); for (size_t i = 0; i < len; ++i) { - wl_list_init(&output->layers[i]); + wl_list_init(&output->shell_layers[i]); } return output;