mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
switched to setting focus with seat_set_focus
This commit is contained in:
parent
798fc24081
commit
63e45bf321
1 changed files with 2 additions and 6 deletions
|
@ -352,7 +352,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
|
||||||
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device,
|
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device,
|
||||||
event->x, event->y, &lx, &ly);
|
event->x, event->y, &lx, &ly);
|
||||||
double sx, sy;
|
double sx, sy;
|
||||||
node_at_coords(seat, lx, ly, &surface, &sx, &sy);
|
struct sway_node *focused_node = node_at_coords(seat, lx, ly, &surface, &sx, &sy);
|
||||||
|
|
||||||
seat->touch_id = event->touch_id;
|
seat->touch_id = event->touch_id;
|
||||||
seat->touch_x = lx;
|
seat->touch_x = lx;
|
||||||
|
@ -369,11 +369,7 @@ static void handle_touch_down(struct wl_listener *listener, void *data) {
|
||||||
cursor_hide(cursor);
|
cursor_hide(cursor);
|
||||||
}
|
}
|
||||||
|
|
||||||
//move cursor so focus follows touch
|
seat_set_focus(seat, focused_node);
|
||||||
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) {
|
static void handle_touch_up(struct wl_listener *listener, void *data) {
|
||||||
|
|
Loading…
Reference in a new issue