aboutsummaryrefslogtreecommitdiff
path: root/sway/input/cursor.c
diff options
context:
space:
mode:
authorSome Chinese Guy <freemancrowbar100500@gmail.com>2020-03-23 12:18:50 +0300
committerDrew DeVault <sir@cmpwn.com>2020-03-29 20:50:36 +0200
commit798fc240812cc7136a7f2f755e68194884f5dbc4 (patch)
treeabb9fc2bf66371e5eed794909bb667b7c7939789 /sway/input/cursor.c
parent484f7677b0d5e07eb0e42d70343c4951ac6f24cf (diff)
Added focus following for touch_down
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r--sway/input/cursor.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c
index 3a4a69b6..5dc7290d 100644
--- a/sway/input/cursor.c
+++ b/sway/input/cursor.c
@@ -368,6 +368,12 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
event->touch_id, sx, sy);
cursor_hide(cursor);
}
+
+ //move cursor so focus follows touch
+ float delta_x = lx - cursor->cursor->x;
+ float delta_y = ly - cursor->cursor->y;
+ cursor_motion(cursor, 0, event->device, delta_x,
+ delta_y, delta_x, delta_y);
}
static void handle_touch_up(struct wl_listener *listener, void *data) {