libweston: Use struct timespec for button events

Change code related to button 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-16 18:20:55 +02:00
committed by Pekka Paalanen
parent 84b31f8956
commit 215bedc88b
15 changed files with 71 additions and 40 deletions
+5 -2
View File
@@ -35,6 +35,7 @@
#include "libweston-desktop.h"
#include "internal.h"
#include "shared/timespec-util.h"
struct weston_desktop_seat {
struct wl_listener seat_destroy_listener;
@@ -116,7 +117,8 @@ weston_desktop_seat_popup_grab_pointer_motion(struct weston_pointer_grab *grab,
static void
weston_desktop_seat_popup_grab_pointer_button(struct weston_pointer_grab *grab,
uint32_t time, uint32_t button,
const struct timespec *time,
uint32_t button,
enum wl_pointer_button_state state)
{
struct weston_desktop_seat *seat =
@@ -130,7 +132,8 @@ weston_desktop_seat_popup_grab_pointer_button(struct weston_pointer_grab *grab,
if (weston_pointer_has_focus_resource(pointer))
weston_pointer_send_button(pointer, time, button, state);
else if (state == WL_POINTER_BUTTON_STATE_RELEASED &&
(initial_up || (time - grab->pointer->grab_time) > 500))
(initial_up ||
(timespec_sub_to_msec(time, &grab->pointer->grab_time) > 500)))
weston_desktop_seat_popup_grab_end(seat);
}