aboutsummaryrefslogtreecommitdiffstats
path: root/sway/desktop/output.c
diff options
context:
space:
mode:
authorLibravatar emersion <contact@emersion.fr>2018-07-27 18:53:15 +0100
committerLibravatar emersion <contact@emersion.fr>2018-07-29 14:33:26 +0100
commita0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5 (patch)
tree118ca09465a6a826f47beb57a9012d921c71bac0 /sway/desktop/output.c
parentwip: redesign output_drag_icons_for_each_surface iterator (diff)
downloadsway-a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5.tar.gz
sway-a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5.tar.zst
sway-a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5.zip
wip: redesign output_layer_for_each_surface iterator
Diffstat (limited to 'sway/desktop/output.c')
-rw-r--r--sway/desktop/output.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/sway/desktop/output.c b/sway/desktop/output.c
index e83a9a3d..5e309250 100644
--- a/sway/desktop/output.c
+++ b/sway/desktop/output.c
@@ -167,15 +167,15 @@ void output_view_for_each_surface(struct sway_view *view,
167 view_for_each_surface(view, iterator, user_data); 167 view_for_each_surface(view, iterator, user_data);
168} 168}
169 169
170void output_layer_for_each_surface(struct wl_list *layer_surfaces, 170void output_layer_for_each_surface(struct sway_output *output,
171 struct root_geometry *geo, wlr_surface_iterator_func_t iterator, 171 struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator,
172 void *user_data) { 172 void *user_data) {
173 struct sway_layer_surface *layer_surface; 173 struct sway_layer_surface *layer_surface;
174 wl_list_for_each(layer_surface, layer_surfaces, link) { 174 wl_list_for_each(layer_surface, layer_surfaces, link) {
175 struct wlr_layer_surface *wlr_layer_surface = 175 struct wlr_layer_surface *wlr_layer_surface =
176 layer_surface->layer_surface; 176 layer_surface->layer_surface;
177 output_surface_for_each_surface(wlr_layer_surface->surface, 177 output_surface_for_each_surface2(output, wlr_layer_surface->surface,
178 layer_surface->geo.x, layer_surface->geo.y, geo, iterator, 178 layer_surface->geo.x, layer_surface->geo.y, 0, iterator,
179 user_data); 179 user_data);
180 } 180 }
181} 181}
@@ -288,10 +288,10 @@ static void send_frame_done_iterator2(struct sway_output *output,
288 wlr_surface_send_frame_done(surface, data->when); 288 wlr_surface_send_frame_done(surface, data->when);
289} 289}
290 290
291static void send_frame_done_layer(struct send_frame_done_data *data, 291static void send_frame_done_layer(struct sway_output *output,
292 struct wl_list *layer_surfaces) { 292 struct wl_list *layer_surfaces, struct send_frame_done_data *data) {
293 output_layer_for_each_surface(layer_surfaces, &data->root_geo, 293 output_layer_for_each_surface(output, layer_surfaces,
294 send_frame_done_iterator, data); 294 send_frame_done_iterator2, data);
295} 295}
296 296
297#ifdef HAVE_XWAYLAND 297#ifdef HAVE_XWAYLAND
@@ -352,10 +352,10 @@ static void send_frame_done(struct sway_output *output, struct timespec *when) {
352 &root_container.sway_root->xwayland_unmanaged); 352 &root_container.sway_root->xwayland_unmanaged);
353#endif 353#endif
354 } else { 354 } else {
355 send_frame_done_layer(&data, 355 send_frame_done_layer(output,
356 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND]); 356 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BACKGROUND], &data);
357 send_frame_done_layer(&data, 357 send_frame_done_layer(output,
358 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM]); 358 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_BOTTOM], &data);
359 359
360 send_frame_done_container(&data, workspace); 360 send_frame_done_container(&data, workspace);
361 send_frame_done_container(&data, workspace->sway_workspace->floating); 361 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) {
364 send_frame_done_unmanaged(&data, 364 send_frame_done_unmanaged(&data,
365 &root_container.sway_root->xwayland_unmanaged); 365 &root_container.sway_root->xwayland_unmanaged);
366#endif 366#endif
367 send_frame_done_layer(&data, 367 send_frame_done_layer(output,
368 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP]); 368 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_TOP], &data);
369 } 369 }
370 370
371send_frame_overlay: 371send_frame_overlay:
372 send_frame_done_layer(&data, 372 send_frame_done_layer(output,
373 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY]); 373 &output->layers[ZWLR_LAYER_SHELL_V1_LAYER_OVERLAY], &data);
374 send_frame_done_drag_icons(&data, &root_container.sway_root->drag_icons); 374 send_frame_done_drag_icons(&data, &root_container.sway_root->drag_icons);
375} 375}
376 376