output: simplify loop over layer surfaces

This commit is contained in:
Isaac Freund 2020-06-30 16:05:06 +02:00 committed by Simon Ser
parent 492267a5d6
commit 76adcc3fd3

View file

@ -434,18 +434,10 @@ struct sway_workspace *output_get_active_workspace(struct sway_output *output) {
} }
bool output_has_opaque_overlay_layer_surface(struct sway_output *output) { bool output_has_opaque_overlay_layer_surface(struct sway_output *output) {
struct wlr_layer_surface_v1 *wlr_layer_surface_v1; struct sway_layer_surface *sway_layer_surface;
wl_list_for_each(wlr_layer_surface_v1, &server.layer_shell->surfaces, link) { wl_list_for_each(sway_layer_surface,
if (wlr_layer_surface_v1->output != output->wlr_output || &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], link) {
wlr_layer_surface_v1->current.layer != ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY) { struct wlr_surface *wlr_surface = sway_layer_surface->layer_surface->surface;
continue;
}
struct wlr_surface *wlr_surface = wlr_layer_surface_v1->surface;
struct sway_layer_surface *sway_layer_surface =
layer_from_wlr_layer_surface_v1(wlr_layer_surface_v1);
if (sway_layer_surface == NULL) {
continue;
}
pixman_box32_t output_box = { pixman_box32_t output_box = {
.x2 = output->width, .x2 = output->width,
.y2 = output->height, .y2 = output->height,