aboutsummaryrefslogtreecommitdiff
path: root/rootston/output.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-11-19 22:28:51 +0100
committeremersion <contact@emersion.fr>2017-11-19 22:28:51 +0100
commit7904b625f0c6a8cef684d60ba136de1ba48e848e (patch)
tree3d7001509a6229e1b17a0f4c26960e720857c8a9 /rootston/output.c
parent7375931686e6a58c08a7727ce2f5d88e0be9adfa (diff)
parentfae8d6289a470b8abcf36a5f4b0030ef504caf0b (diff)
Merge branch 'master' into laggy-move-resize
Diffstat (limited to 'rootston/output.c')
-rw-r--r--rootston/output.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/rootston/output.c b/rootston/output.c
index 28312c2c..b551dcf4 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -191,18 +191,29 @@ 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;
+ struct wlr_drag_icon *drag_icon = NULL;
struct roots_seat *seat = NULL;
wl_list_for_each(seat, &server->input->seats, link) {
- wl_list_for_each(drag_icon, &seat->drag_icons, link) {
+ wl_list_for_each(drag_icon, &seat->seat->drag_icons, link) {
if (!drag_icon->mapped) {
continue;
}
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 = seat->touch_x + drag_icon->sx;
+ icon_y = seat->touch_y + drag_icon->sy;
+ render_surface(icon, desktop, wlr_output, &now, icon_x, icon_y, 0);
+ }
+ }
}
}