libweston: Use struct timespec for motion events

Change code related to motion events to use struct timespec to represent
time.

This commit is part of a larger effort to transition the Weston codebase
to struct timespec.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
This commit is contained in:
Alexandros Frantzis
2017-11-24 18:01:46 +02:00
committed by Pekka Paalanen
parent e6ac2afa56
commit 84b31f8956
13 changed files with 79 additions and 43 deletions
+5 -1
View File
@@ -44,6 +44,7 @@
#include "weston.h"
#include "shared/helpers.h"
#include "shared/os-compatibility.h"
#include "shared/timespec-util.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h"
struct shared_output {
@@ -140,11 +141,14 @@ ss_seat_handle_motion(void *data, struct wl_pointer *pointer,
uint32_t time, wl_fixed_t x, wl_fixed_t y)
{
struct ss_seat *seat = data;
struct timespec ts;
timespec_from_msec(&ts, time);
/* No transformation of input position is required here because we are
* always receiving the input in the same coordinates as the output. */
notify_motion_absolute(&seat->base, time,
notify_motion_absolute(&seat->base, &ts,
wl_fixed_to_double(x), wl_fixed_to_double(y));
notify_pointer_frame(&seat->base);
}