mirror of
https://github.com/swaywm/sway.git
synced 2024-12-29 00:16:22 +01:00
wip: redesign output_layer_for_each_surface iterator
This commit is contained in:
parent
dbf6dd0dae
commit
a0dd977617
3 changed files with 20 additions and 20 deletions
|
@ -93,8 +93,8 @@ void output_view_for_each_surface(struct sway_view *view,
|
||||||
struct sway_output *output, struct root_geometry *geo,
|
struct sway_output *output, struct root_geometry *geo,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
wlr_surface_iterator_func_t iterator, void *user_data);
|
||||||
|
|
||||||
void output_layer_for_each_surface(struct wl_list *layer_surfaces,
|
void output_layer_for_each_surface(struct sway_output *output,
|
||||||
struct root_geometry *geo, wlr_surface_iterator_func_t iterator,
|
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
|
|
|
@ -167,15 +167,15 @@ void output_view_for_each_surface(struct sway_view *view,
|
||||||
view_for_each_surface(view, iterator, user_data);
|
view_for_each_surface(view, iterator, user_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
void output_layer_for_each_surface(struct wl_list *layer_surfaces,
|
void output_layer_for_each_surface(struct sway_output *output,
|
||||||
struct root_geometry *geo, wlr_surface_iterator_func_t iterator,
|
struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
|
||||||
void *user_data) {
|
void *user_data) {
|
||||||
struct sway_layer_surface *layer_surface;
|
struct sway_layer_surface *layer_surface;
|
||||||
wl_list_for_each(layer_surface, layer_surfaces, link) {
|
wl_list_for_each(layer_surface, layer_surfaces, link) {
|
||||||
struct wlr_layer_surface *wlr_layer_surface =
|
struct wlr_layer_surface *wlr_layer_surface =
|
||||||
layer_surface->layer_surface;
|
layer_surface->layer_surface;
|
||||||
output_surface_for_each_surface(wlr_layer_surface->surface,
|
output_surface_for_each_surface2(output, wlr_layer_surface->surface,
|
||||||
layer_surface->geo.x, layer_surface->geo.y, geo, iterator,
|
layer_surface->geo.x, layer_surface->geo.y, 0, iterator,
|
||||||
user_data);
|
user_data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -288,10 +288,10 @@ static void send_frame_done_iterator2(struct sway_output *output,
|
||||||
wlr_surface_send_frame_done(surface, data->when);
|
wlr_surface_send_frame_done(surface, data->when);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_frame_done_layer(struct send_frame_done_data *data,
|
static void send_frame_done_layer(struct sway_output *output,
|
||||||
struct wl_list *layer_surfaces) {
|
struct wl_list *layer_surfaces, struct send_frame_done_data *data) {
|
||||||
output_layer_for_each_surface(layer_surfaces, &data->root_geo,
|
output_layer_for_each_surface(output, layer_surfaces,
|
||||||
send_frame_done_iterator, data);
|
send_frame_done_iterator2, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
|
@ -352,10 +352,10 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) {
|
||||||
&root_container.sway_root->xwayland_unmanaged);
|
&root_container.sway_root->xwayland_unmanaged);
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
send_frame_done_layer(&data,
|
send_frame_done_layer(output,
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]);
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &data);
|
||||||
send_frame_done_layer(&data,
|
send_frame_done_layer(output,
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]);
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &data);
|
||||||
|
|
||||||
send_frame_done_container(&data, workspace);
|
send_frame_done_container(&data, workspace);
|
||||||
send_frame_done_container(&data, workspace->sway_workspace->floating);
|
send_frame_done_container(&data, workspace->sway_workspace->floating);
|
||||||
|
@ -364,13 +364,13 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) {
|
||||||
send_frame_done_unmanaged(&data,
|
send_frame_done_unmanaged(&data,
|
||||||
&root_container.sway_root->xwayland_unmanaged);
|
&root_container.sway_root->xwayland_unmanaged);
|
||||||
#endif
|
#endif
|
||||||
send_frame_done_layer(&data,
|
send_frame_done_layer(output,
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]);
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
send_frame_overlay:
|
send_frame_overlay:
|
||||||
send_frame_done_layer(&data,
|
send_frame_done_layer(output,
|
||||||
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]);
|
&output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &data);
|
||||||
send_frame_done_drag_icons(&data, &root_container.sway_root->drag_icons);
|
send_frame_done_drag_icons(&data, &root_container.sway_root->drag_icons);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,8 +155,8 @@ static void render_layer(struct sway_output *output,
|
||||||
.damage = damage,
|
.damage = damage,
|
||||||
.alpha = 1.0f,
|
.alpha = 1.0f,
|
||||||
};
|
};
|
||||||
output_layer_for_each_surface(layer_surfaces, &data.root_geo,
|
output_layer_for_each_surface(output, layer_surfaces,
|
||||||
render_surface_iterator, &data);
|
render_surface_iterator2, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_XWAYLAND
|
#ifdef HAVE_XWAYLAND
|
||||||
|
|
Loading…
Reference in a new issue