wip: redesign output_drag_icons_for_each_surface iterator

This commit is contained in:
emersion 2018-07-27 18:44:36 +01:00
parent d2172bd331
commit dbf6dd0dae
3 changed files with 13 additions and 12 deletions

View file

@ -103,8 +103,8 @@ void output_unmanaged_for_each_surface(struct sway_output *output,
void *user_data);
#endif
void output_drag_icons_for_each_surface(struct wl_list *drag_icons,
struct sway_output *output, struct root_geometry *geo,
wlr_surface_iterator_func_t iterator, void *user_data);
void output_drag_icons_for_each_surface(struct sway_output *output,
struct wl_list *drag_icons, sway_surface_iterator_func_t iterator,
void *user_data);
#endif

View file

@ -197,17 +197,18 @@ void output_unmanaged_for_each_surface(struct sway_output *output,
}
#endif
void output_drag_icons_for_each_surface(struct wl_list *drag_icons,
struct sway_output *output, struct root_geometry *geo,
wlr_surface_iterator_func_t iterator, void *user_data) {
void output_drag_icons_for_each_surface(struct sway_output *output,
struct wl_list *drag_icons, sway_surface_iterator_func_t iterator,
void *user_data) {
struct sway_drag_icon *drag_icon;
wl_list_for_each(drag_icon, drag_icons, link) {
double ox = drag_icon->x - output->swayc->x;
double oy = drag_icon->y - output->swayc->y;
if (drag_icon->wlr_drag_icon->mapped) {
output_surface_for_each_surface(drag_icon->wlr_drag_icon->surface,
ox, oy, geo, iterator, user_data);
output_surface_for_each_surface2(output,
drag_icon->wlr_drag_icon->surface, ox, oy, 0,
iterator, user_data);
}
}
}
@ -303,8 +304,8 @@ static void send_frame_done_unmanaged(struct send_frame_done_data *data,
static void send_frame_done_drag_icons(struct send_frame_done_data *data,
struct wl_list *drag_icons) {
output_drag_icons_for_each_surface(drag_icons, data->output, &data->root_geo,
send_frame_done_iterator, data);
output_drag_icons_for_each_surface(data->output, drag_icons,
send_frame_done_iterator2, data);
}
static void send_frame_done_container_iterator(struct sway_container *con,

View file

@ -179,8 +179,8 @@ static void render_drag_icons(struct sway_output *output,
.damage = damage,
.alpha = 1.0f,
};
output_drag_icons_for_each_surface(drag_icons, output, &data.root_geo,
render_surface_iterator, &data);
output_drag_icons_for_each_surface(output, drag_icons,
render_surface_iterator2, &data);
}
static void render_rect(struct wlr_output *wlr_output,