Default to current time when triggering cursor events

This commit is contained in:
emersion 2018-04-21 14:07:22 +01:00
parent 7d43cedc95
commit 4cf77e1de4
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 25 additions and 19 deletions

View file

@ -550,9 +550,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
wlr_output, seat->cursor->cursor->x,
seat->cursor->cursor->y)) {
wlr_cursor_warp(seat->cursor->cursor, NULL, x, y);
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
cursor_send_pointer_motion(seat->cursor, now.tv_nsec / 1000);
cursor_send_pointer_motion(seat->cursor, 0);
}
}
}
@ -565,9 +563,7 @@ void seat_set_focus_warp(struct sway_seat *seat,
}
if (last_workspace && last_workspace != new_workspace) {
struct timespec now;
clock_gettime(CLOCK_MONOTONIC, &now);
cursor_send_pointer_motion(seat->cursor, now.tv_nsec / 1000);
cursor_send_pointer_motion(seat->cursor, 0);
}
seat->has_focus = (container != NULL);