From ac4841ba37aee8c0d661c44f2de2fd6ed5d38086 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Wed, 15 Nov 2017 06:43:30 -0500 Subject: put dnd icon in the right place --- rootston/cursor.c | 5 +++++ rootston/output.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'rootston') diff --git a/rootston/cursor.c b/rootston/cursor.c index 16441f4b..7e261234 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -270,6 +270,11 @@ void roots_cursor_handle_touch_motion(struct roots_cursor *cursor, wlr_seat_touch_point_clear_focus(cursor->seat->seat, event->time_msec, event->slot); } + + if (wlr_seat_touch_has_grab(cursor->seat->seat)) { + cursor->seat->touch_grab_x = lx; + cursor->seat->touch_grab_y = ly; + } } void roots_cursor_handle_tool_axis(struct roots_cursor *cursor, diff --git a/rootston/output.c b/rootston/output.c index 82760632..0b13a959 100644 --- a/rootston/output.c +++ b/rootston/output.c @@ -209,8 +209,8 @@ static void output_frame_notify(struct wl_listener *listener, void *data) { 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 + icon_x = seat->touch_grab_x + drag_icon->sx; + icon_y = seat->touch_grab_y + drag_icon->sy; render_surface(icon, desktop, wlr_output, &now, icon_x, icon_y, 0); } } -- cgit v1.2.3