wlr-data-device: drag icons

This commit is contained in:
Tony Crisci 2017-10-15 11:06:03 -04:00
parent a1bfa4a2f2
commit df0a8d3abe
8 changed files with 89 additions and 5 deletions

View file

@ -150,6 +150,21 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
render_view(view, desktop, wlr_output, &now);
}
struct roots_drag_icon *drag_icon = NULL;
wl_list_for_each(drag_icon, &server->input->drag_icons, link) {
if (!drag_icon->mapped) {
continue;
}
struct wlr_surface *icon = drag_icon->surface;
struct wlr_cursor *cursor = server->input->cursor;
// TODO should also use the hotspot to determine the location, but
// hotspot is broken right now.
double icon_x = cursor->x - icon->current->sx;
double icon_y = cursor->y - icon->current->sy;
render_surface(icon, desktop, wlr_output, &now, icon_x, icon_y, 0);
}
wlr_renderer_end(server->renderer);
wlr_output_swap_buffers(wlr_output);