basic touch dnd

This commit is contained in:
Tony Crisci 2017-11-13 15:41:48 -05:00
parent 94e7dc8a3e
commit 6a516f7c41
9 changed files with 210 additions and 78 deletions

View file

@ -200,9 +200,20 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
}
struct wlr_surface *icon = drag_icon->surface;
struct wlr_cursor *cursor = seat->cursor->cursor;
double icon_x = cursor->x + drag_icon->sx;
double icon_y = cursor->y + drag_icon->sy;
render_surface(icon, desktop, wlr_output, &now, icon_x, icon_y, 0);
double icon_x = 0, icon_y = 0;
if (drag_icon->is_pointer) {
icon_x = cursor->x + drag_icon->sx;
icon_y = cursor->y + drag_icon->sy;
render_surface(icon, desktop, wlr_output, &now, icon_x, icon_y, 0);
} else {
struct wlr_touch_point *point =
wlr_seat_touch_get_point(seat->seat, drag_icon->touch_id);
if (point) {
icon_x = point->sx + drag_icon->sx; // TODO plus view x
icon_y = point->sy + drag_icon->sy; // TODO plus view y
render_surface(icon, desktop, wlr_output, &now, icon_x, icon_y, 0);
}
}
}
}