mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
wip: redesign output_drag_icons_for_each_surface iterator
This commit is contained in:
parent
d2172bd331
commit
dbf6dd0dae
3 changed files with 13 additions and 12 deletions
|
@ -103,8 +103,8 @@ void output_unmanaged_for_each_surface(struct sway_output *output,
|
||||||
void *user_data);
|
void *user_data);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void output_drag_icons_for_each_surface(struct wl_list *drag_icons,
|
void output_drag_icons_for_each_surface(struct sway_output *output,
|
||||||
struct sway_output *output, struct root_geometry *geo,
|
struct wl_list *drag_icons, sway_surface_iterator_func_t iterator,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data);
|
void *user_data);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -197,17 +197,18 @@ void output_unmanaged_for_each_surface(struct sway_output *output,
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void output_drag_icons_for_each_surface(struct wl_list *drag_icons,
|
void output_drag_icons_for_each_surface(struct sway_output *output,
|
||||||
struct sway_output *output, struct root_geometry *geo,
|
struct wl_list *drag_icons, sway_surface_iterator_func_t iterator,
|
||||||
wlr_surface_iterator_func_t iterator, void *user_data) {
|
void *user_data) {
|
||||||
struct sway_drag_icon *drag_icon;
|
struct sway_drag_icon *drag_icon;
|
||||||
wl_list_for_each(drag_icon, drag_icons, link) {
|
wl_list_for_each(drag_icon, drag_icons, link) {
|
||||||
double ox = drag_icon->x - output->swayc->x;
|
double ox = drag_icon->x - output->swayc->x;
|
||||||
double oy = drag_icon->y - output->swayc->y;
|
double oy = drag_icon->y - output->swayc->y;
|
||||||
|
|
||||||
if (drag_icon->wlr_drag_icon->mapped) {
|
if (drag_icon->wlr_drag_icon->mapped) {
|
||||||
output_surface_for_each_surface(drag_icon->wlr_drag_icon->surface,
|
output_surface_for_each_surface2(output,
|
||||||
ox, oy, geo, iterator, user_data);
|
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,
|
static void send_frame_done_drag_icons(struct send_frame_done_data *data,
|
||||||
struct wl_list *drag_icons) {
|
struct wl_list *drag_icons) {
|
||||||
output_drag_icons_for_each_surface(drag_icons, data->output, &data->root_geo,
|
output_drag_icons_for_each_surface(data->output, drag_icons,
|
||||||
send_frame_done_iterator, data);
|
send_frame_done_iterator2, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void send_frame_done_container_iterator(struct sway_container *con,
|
static void send_frame_done_container_iterator(struct sway_container *con,
|
||||||
|
|
|
@ -179,8 +179,8 @@ static void render_drag_icons(struct sway_output *output,
|
||||||
.damage = damage,
|
.damage = damage,
|
||||||
.alpha = 1.0f,
|
.alpha = 1.0f,
|
||||||
};
|
};
|
||||||
output_drag_icons_for_each_surface(drag_icons, output, &data.root_geo,
|
output_drag_icons_for_each_surface(output, drag_icons,
|
||||||
render_surface_iterator, &data);
|
render_surface_iterator2, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void render_rect(struct wlr_output *wlr_output,
|
static void render_rect(struct wlr_output *wlr_output,
|
||||||
|
|
Loading…
Reference in a new issue