diff options
-rw-r--r-- | sway/input/cursor.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 5dc7290d..878a8e99 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c | |||
@@ -352,7 +352,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) { | |||
352 | wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, | 352 | wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, |
353 | event->x, event->y, &lx, &ly); | 353 | event->x, event->y, &lx, &ly); |
354 | double sx, sy; | 354 | double sx, sy; |
355 | node_at_coords(seat, lx, ly, &surface, &sx, &sy); | 355 | struct sway_node *focused_node = node_at_coords(seat, lx, ly, &surface, &sx, &sy); |
356 | 356 | ||
357 | seat->touch_id = event->touch_id; | 357 | seat->touch_id = event->touch_id; |
358 | seat->touch_x = lx; | 358 | seat->touch_x = lx; |
@@ -369,11 +369,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) { | |||
369 | cursor_hide(cursor); | 369 | cursor_hide(cursor); |
370 | } | 370 | } |
371 | 371 | ||
372 | //move cursor so focus follows touch | 372 | seat_set_focus(seat, focused_node); |
373 | float delta_x = lx - cursor->cursor->x; | ||
374 | float delta_y = ly - cursor->cursor->y; | ||
375 | cursor_motion(cursor, 0, event->device, delta_x, | ||
376 | delta_y, delta_x, delta_y); | ||
377 | } | 373 | } |
378 | 374 | ||
379 | static void handle_touch_up(struct wl_listener *listener, void *data) { | 375 | static void handle_touch_up(struct wl_listener *listener, void *data) { |