aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Some Chinese Guy <freemancrowbar100500@gmail.com>2020-03-23 12:18:50 +0300
committerLibravatar Drew DeVault <sir@cmpwn.com>2020-03-29 20:50:36 +0200
commit798fc240812cc7136a7f2f755e68194884f5dbc4 (patch)
treeabb9fc2bf66371e5eed794909bb667b7c7939789
parentswaynag: fix segfault on exit when arguments are not correct (diff)
downloadsway-798fc240812cc7136a7f2f755e68194884f5dbc4.tar.gz
sway-798fc240812cc7136a7f2f755e68194884f5dbc4.tar.zst
sway-798fc240812cc7136a7f2f755e68194884f5dbc4.zip
Added focus following for touch_down
-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) {
368 event->touch_id, sx, sy); 368 event->touch_id, sx, sy);
369 cursor_hide(cursor); 369 cursor_hide(cursor);
370 } 370 }
371
372 //move cursor so focus follows touch
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);
371} 377}
372 378
373static void handle_touch_up(struct wl_listener *listener, void *data) { 379static void handle_touch_up(struct wl_listener *listener, void *data) {