diff options
author | emersion <contact@emersion.fr> | 2018-07-27 18:53:15 +0100 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2018-07-29 14:33:26 +0100 |
commit | a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5 (patch) | |
tree | 118ca09465a6a826f47beb57a9012d921c71bac0 | |
parent | wip: redesign output_drag_icons_for_each_surface iterator (diff) | |
download | sway-a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5.tar.gz sway-a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5.tar.zst sway-a0dd9776172796f65b0fce0a8e5cfb66bdb2e2e5.zip |
wip: redesign output_layer_for_each_surface iterator
-rw-r--r-- | include/sway/output.h | 4 | ||||
-rw-r--r-- | sway/desktop/output.c | 32 | ||||
-rw-r--r-- | sway/desktop/render.c | 4 |
3 files changed, 20 insertions, 20 deletions
diff --git a/include/sway/output.h b/include/sway/output.h index 10a14207..c1763b26 100644 --- a/include/sway/output.h +++ b/include/sway/output.h | |||
@@ -93,8 +93,8 @@ void output_view_for_each_surface(struct sway_view *view, | |||
93 | struct sway_output *output, struct root_geometry *geo, | 93 | struct sway_output *output, struct root_geometry *geo, |
94 | wlr_surface_iterator_func_t iterator, void *user_data); | 94 | wlr_surface_iterator_func_t iterator, void *user_data); |
95 | 95 | ||
96 | void output_layer_for_each_surface(struct wl_list *layer_surfaces, | 96 | void output_layer_for_each_surface(struct sway_output *output, |
97 | struct root_geometry *geo, wlr_surface_iterator_func_t iterator, | 97 | struct wl_list *layer_surfaces, sway_surface_iterator_func_t iterator, |
98 | void *user_data); | 98 | void *user_data); |
99 | 99 | ||
100 | #ifdef HAVE_XWAYLAND | 100 | #ifdef HAVE_XWAYLAND |
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 | ||
170 | void output_layer_for_each_surface(struct wl_list *layer_surfaces, | 170 | void 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 | ||
291 | static void send_frame_done_layer(struct send_frame_done_data *data, | 291 | static 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 | ||
371 | send_frame_overlay: | 371 | send_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 | ||
diff --git a/sway/desktop/render.c b/sway/desktop/render.c index 1270b7cf..35dc3edc 100644 --- a/sway/desktop/render.c +++ b/sway/desktop/render.c | |||
@@ -155,8 +155,8 @@ static void render_layer(struct sway_output *output, | |||
155 | .damage = damage, | 155 | .damage = damage, |
156 | .alpha = 1.0f, | 156 | .alpha = 1.0f, |
157 | }; | 157 | }; |
158 | output_layer_for_each_surface(layer_surfaces, &data.root_geo, | 158 | output_layer_for_each_surface(output, layer_surfaces, |
159 | render_surface_iterator, &data); | 159 | render_surface_iterator2, &data); |
160 | } | 160 | } |
161 | 161 | ||
162 | #ifdef HAVE_XWAYLAND | 162 | #ifdef HAVE_XWAYLAND |