mirror of
https://gitlab.freedesktop.org/wayland/weston
synced 2024-10-04 21:42:37 +00:00
libweston: Use struct timespec for touch up events
Change code related to touch up 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:
parent
9448deb073
commit
27a51b83e5
|
@ -1338,7 +1338,8 @@ touch_move_grab_down(struct weston_touch_grab *grab,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_move_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id)
|
touch_move_grab_up(struct weston_touch_grab *grab, const struct timespec *time,
|
||||||
|
int touch_id)
|
||||||
{
|
{
|
||||||
struct weston_touch_move_grab *move =
|
struct weston_touch_move_grab *move =
|
||||||
(struct weston_touch_move_grab *) container_of(
|
(struct weston_touch_move_grab *) container_of(
|
||||||
|
|
|
@ -1591,7 +1591,8 @@ touch_nope_grab_down(struct weston_touch_grab *grab,
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
touch_move_workspace_grab_up(struct weston_touch_grab *grab, uint32_t time,
|
touch_move_workspace_grab_up(struct weston_touch_grab *grab,
|
||||||
|
const struct timespec *time,
|
||||||
int touch_id)
|
int touch_id)
|
||||||
{
|
{
|
||||||
struct touch_move_grab *tch_move_grab = (struct touch_move_grab *)grab;
|
struct touch_move_grab *tch_move_grab = (struct touch_move_grab *)grab;
|
||||||
|
|
|
@ -189,7 +189,8 @@ weston_desktop_seat_popup_grab_touch_down(struct weston_touch_grab *grab,
|
||||||
|
|
||||||
static void
|
static void
|
||||||
weston_desktop_seat_popup_grab_touch_up(struct weston_touch_grab *grab,
|
weston_desktop_seat_popup_grab_touch_up(struct weston_touch_grab *grab,
|
||||||
uint32_t time, int touch_id)
|
const struct timespec *time,
|
||||||
|
int touch_id)
|
||||||
{
|
{
|
||||||
weston_touch_send_up(grab->touch, time, touch_id);
|
weston_touch_send_up(grab->touch, time, touch_id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -310,7 +310,7 @@ struct weston_touch_grab_interface {
|
||||||
wl_fixed_t sx,
|
wl_fixed_t sx,
|
||||||
wl_fixed_t sy);
|
wl_fixed_t sy);
|
||||||
void (*up)(struct weston_touch_grab *grab,
|
void (*up)(struct weston_touch_grab *grab,
|
||||||
uint32_t time,
|
const struct timespec *time,
|
||||||
int touch_id);
|
int touch_id);
|
||||||
void (*motion)(struct weston_touch_grab *grab,
|
void (*motion)(struct weston_touch_grab *grab,
|
||||||
uint32_t time,
|
uint32_t time,
|
||||||
|
@ -519,7 +519,8 @@ void
|
||||||
weston_touch_send_down(struct weston_touch *touch, const struct timespec *time,
|
weston_touch_send_down(struct weston_touch *touch, const struct timespec *time,
|
||||||
int touch_id, wl_fixed_t x, wl_fixed_t y);
|
int touch_id, wl_fixed_t x, wl_fixed_t y);
|
||||||
void
|
void
|
||||||
weston_touch_send_up(struct weston_touch *touch, uint32_t time, int touch_id);
|
weston_touch_send_up(struct weston_touch *touch, const struct timespec *time,
|
||||||
|
int touch_id);
|
||||||
void
|
void
|
||||||
weston_touch_send_motion(struct weston_touch *touch, uint32_t time,
|
weston_touch_send_motion(struct weston_touch *touch, uint32_t time,
|
||||||
int touch_id, wl_fixed_t x, wl_fixed_t y);
|
int touch_id, wl_fixed_t x, wl_fixed_t y);
|
||||||
|
|
|
@ -738,7 +738,7 @@ data_device_end_touch_drag_grab(struct weston_touch_drag *drag)
|
||||||
|
|
||||||
static void
|
static void
|
||||||
drag_grab_touch_up(struct weston_touch_grab *grab,
|
drag_grab_touch_up(struct weston_touch_grab *grab,
|
||||||
uint32_t time, int touch_id)
|
const struct timespec *time, int touch_id)
|
||||||
{
|
{
|
||||||
struct weston_touch_drag *touch_drag =
|
struct weston_touch_drag *touch_drag =
|
||||||
container_of(grab, struct weston_touch_drag, grab);
|
container_of(grab, struct weston_touch_drag, grab);
|
||||||
|
|
|
@ -713,25 +713,28 @@ default_grab_touch_down(struct weston_touch_grab *grab,
|
||||||
* resources of the client which currently has the surface with touch focus.
|
* resources of the client which currently has the surface with touch focus.
|
||||||
*/
|
*/
|
||||||
WL_EXPORT void
|
WL_EXPORT void
|
||||||
weston_touch_send_up(struct weston_touch *touch, uint32_t time, int touch_id)
|
weston_touch_send_up(struct weston_touch *touch, const struct timespec *time,
|
||||||
|
int touch_id)
|
||||||
{
|
{
|
||||||
struct wl_display *display = touch->seat->compositor->wl_display;
|
struct wl_display *display = touch->seat->compositor->wl_display;
|
||||||
uint32_t serial;
|
uint32_t serial;
|
||||||
struct wl_resource *resource;
|
struct wl_resource *resource;
|
||||||
struct wl_list *resource_list;
|
struct wl_list *resource_list;
|
||||||
|
uint32_t msecs;
|
||||||
|
|
||||||
if (!weston_touch_has_focus_resource(touch))
|
if (!weston_touch_has_focus_resource(touch))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
resource_list = &touch->focus_resource_list;
|
resource_list = &touch->focus_resource_list;
|
||||||
serial = wl_display_next_serial(display);
|
serial = wl_display_next_serial(display);
|
||||||
|
msecs = timespec_to_msec(time);
|
||||||
wl_resource_for_each(resource, resource_list)
|
wl_resource_for_each(resource, resource_list)
|
||||||
wl_touch_send_up(resource, serial, time, touch_id);
|
wl_touch_send_up(resource, serial, msecs, touch_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
default_grab_touch_up(struct weston_touch_grab *grab,
|
default_grab_touch_up(struct weston_touch_grab *grab,
|
||||||
uint32_t time, int touch_id)
|
const struct timespec *time, int touch_id)
|
||||||
{
|
{
|
||||||
weston_touch_send_up(grab->touch, time, touch_id);
|
weston_touch_send_up(grab->touch, time, touch_id);
|
||||||
}
|
}
|
||||||
|
@ -2215,7 +2218,7 @@ notify_touch(struct weston_seat *seat, const struct timespec *time,
|
||||||
weston_compositor_idle_release(ec);
|
weston_compositor_idle_release(ec);
|
||||||
touch->num_tp--;
|
touch->num_tp--;
|
||||||
|
|
||||||
grab->interface->up(grab, timespec_to_msec(time), touch_id);
|
grab->interface->up(grab, time, touch_id);
|
||||||
if (touch->num_tp == 0)
|
if (touch->num_tp == 0)
|
||||||
weston_touch_set_focus(touch, NULL);
|
weston_touch_set_focus(touch, NULL);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue