{
struct ss_seat *seat = data;
struct weston_pointer_axis_event weston_event;
+ struct timespec ts;
weston_event.axis = axis;
weston_event.value = wl_fixed_to_double(value);
weston_event.has_discrete = false;
- notify_axis(&seat->base, time, &weston_event);
+ timespec_from_msec(&ts, time);
+
+ notify_axis(&seat->base, &ts, &weston_event);
notify_pointer_frame(&seat->base);
}
static void
exposay_axis(struct weston_pointer_grab *grab,
- uint32_t time, struct weston_pointer_axis_event *event)
+ const struct timespec *time,
+ struct weston_pointer_axis_event *event)
{
}
static void
noop_grab_axis(struct weston_pointer_grab *grab,
- uint32_t time, struct weston_pointer_axis_event *event)
+ const struct timespec *time,
+ struct weston_pointer_axis_event *event)
{
}
}
static void
-surface_opacity_binding(struct weston_pointer *pointer, uint32_t time,
+surface_opacity_binding(struct weston_pointer *pointer,
+ const struct timespec *time,
struct weston_pointer_axis_event *event,
void *data)
{
}
static void
-do_zoom(struct weston_seat *seat, uint32_t time, uint32_t key, uint32_t axis,
- double value)
+do_zoom(struct weston_seat *seat, const struct timespec *time, uint32_t key,
+ uint32_t axis, double value)
{
struct weston_compositor *compositor = seat->compositor;
struct weston_pointer *pointer = weston_seat_get_pointer(seat);
}
static void
-zoom_axis_binding(struct weston_pointer *pointer, uint32_t time,
+zoom_axis_binding(struct weston_pointer *pointer, const struct timespec *time,
struct weston_pointer_axis_event *event,
void *data)
{
zoom_key_binding(struct weston_keyboard *keyboard, uint32_t time,
uint32_t key, void *data)
{
- do_zoom(keyboard->seat, time, key, 0, 0);
+ struct timespec ts;
+
+ timespec_from_msec(&ts, time);
+
+ do_zoom(keyboard->seat, &ts, key, 0, 0);
}
static void
static void
pointer_default_grab_axis(struct weston_pointer_grab *grab,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
weston_pointer_send_axis(grab->pointer, time, event);
static void
weston_desktop_seat_popup_grab_pointer_axis(struct weston_pointer_grab *grab,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
weston_pointer_send_axis(grab->pointer, time, event);
int
weston_compositor_run_axis_binding(struct weston_compositor *compositor,
struct weston_pointer *pointer,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
struct weston_binding *b, *tmp;
weston_event.discrete = (int)value;
weston_event.has_discrete = true;
- notify_axis(peerContext->item.seat, weston_compositor_get_time(),
- &weston_event);
+ timespec_from_msec(&time, weston_compositor_get_time());
+
+ notify_axis(peerContext->item.seat, &time, &weston_event);
need_frame = true;
}
{
struct wayland_input *input = data;
struct weston_pointer_axis_event weston_event;
+ struct timespec ts;
weston_event.axis = axis;
weston_event.value = wl_fixed_to_double(value);
input->horiz.has_discrete = false;
}
- notify_axis(&input->base, time, &weston_event);
+ timespec_from_msec(&ts, time);
+
+ notify_axis(&input->base, &ts, &weston_event);
if (input->seat_version < WL_POINTER_FRAME_SINCE_VERSION)
notify_pointer_frame(&input->base);
{
struct wayland_input *input = data;
struct weston_pointer_axis_event weston_event;
+ struct timespec ts;
weston_event.axis = axis;
weston_event.value = 0;
- notify_axis(&input->base, time, &weston_event);
+ timespec_from_msec(&ts, time);
+
+ notify_axis(&input->base, &ts, &weston_event);
}
static void
weston_event.has_discrete = true;
weston_event.axis =
WL_POINTER_AXIS_VERTICAL_SCROLL;
- notify_axis(&b->core_seat,
- weston_compositor_get_time(),
- &weston_event);
+ timespec_from_msec(&time, weston_compositor_get_time());
+ notify_axis(&b->core_seat, &time, &weston_event);
notify_pointer_frame(&b->core_seat);
}
return;
weston_event.has_discrete = true;
weston_event.axis =
WL_POINTER_AXIS_VERTICAL_SCROLL;
- notify_axis(&b->core_seat,
- weston_compositor_get_time(),
- &weston_event);
+ timespec_from_msec(&time, weston_compositor_get_time());
+ notify_axis(&b->core_seat, &time, &weston_event);
notify_pointer_frame(&b->core_seat);
}
return;
weston_event.has_discrete = true;
weston_event.axis =
WL_POINTER_AXIS_HORIZONTAL_SCROLL;
- notify_axis(&b->core_seat,
- weston_compositor_get_time(),
- &weston_event);
+ timespec_from_msec(&time, weston_compositor_get_time());
+ notify_axis(&b->core_seat, &time, &weston_event);
notify_pointer_frame(&b->core_seat);
}
return;
weston_event.has_discrete = true;
weston_event.axis =
WL_POINTER_AXIS_HORIZONTAL_SCROLL;
- notify_axis(&b->core_seat,
- weston_compositor_get_time(),
- &weston_event);
+ timespec_from_msec(&time, weston_compositor_get_time());
+ notify_axis(&b->core_seat, &time, &weston_event);
notify_pointer_frame(&b->core_seat);
}
return;
const struct timespec *time,
uint32_t button, uint32_t state);
void (*axis)(struct weston_pointer_grab *grab,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event);
void (*axis_source)(struct weston_pointer_grab *grab, uint32_t source);
void (*frame)(struct weston_pointer_grab *grab);
uint32_t button, uint32_t state_w);
void
weston_pointer_send_axis(struct weston_pointer *pointer,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event);
void
weston_pointer_send_axis_source(struct weston_pointer *pointer,
notify_button(struct weston_seat *seat, const struct timespec *time,
int32_t button, enum wl_pointer_button_state state);
void
-notify_axis(struct weston_seat *seat, uint32_t time,
+notify_axis(struct weston_seat *seat, const struct timespec *time,
struct weston_pointer_axis_event *event);
void
notify_axis_source(struct weston_seat *seat, uint32_t source);
void *data);
typedef void (*weston_axis_binding_handler_t)(struct weston_pointer *pointer,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event,
void *data);
struct weston_binding *
int touch_type);
int
weston_compositor_run_axis_binding(struct weston_compositor *compositor,
- struct weston_pointer *pointer, uint32_t time,
+ struct weston_pointer *pointer,
+ const struct timespec *time,
struct weston_pointer_axis_event *event);
int
weston_compositor_run_debug_binding(struct weston_compositor *compositor,
static void
drag_grab_axis(struct weston_pointer_grab *grab,
- uint32_t time, struct weston_pointer_axis_event *event)
+ const struct timespec *time,
+ struct weston_pointer_axis_event *event)
{
}
*/
WL_EXPORT void
weston_pointer_send_axis(struct weston_pointer *pointer,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
struct wl_resource *resource;
struct wl_list *resource_list;
+ uint32_t msecs;
if (!weston_pointer_has_focus_resource(pointer))
return;
resource_list = &pointer->focus_client->pointer_resources;
+ msecs = timespec_to_msec(time);
wl_resource_for_each(resource, resource_list) {
if (event->has_discrete &&
wl_resource_get_version(resource) >=
event->discrete);
if (event->value)
- wl_pointer_send_axis(resource, time,
+ wl_pointer_send_axis(resource, msecs,
event->axis,
wl_fixed_from_double(event->value));
else if (wl_resource_get_version(resource) >=
WL_POINTER_AXIS_STOP_SINCE_VERSION)
- wl_pointer_send_axis_stop(resource, time,
+ wl_pointer_send_axis_stop(resource, msecs,
event->axis);
}
}
static void
default_grab_pointer_axis(struct weston_pointer_grab *grab,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
weston_pointer_send_axis(grab->pointer, time, event);
}
WL_EXPORT void
-notify_axis(struct weston_seat *seat, uint32_t time,
+notify_axis(struct weston_seat *seat, const struct timespec *time,
struct weston_pointer_axis_event *event)
{
struct weston_compositor *compositor = seat->compositor;
static void
locked_pointer_grab_pointer_axis(struct weston_pointer_grab *grab,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
weston_pointer_send_axis(grab->pointer, time, event);
static void
confined_pointer_grab_pointer_axis(struct weston_pointer_grab *grab,
- uint32_t time,
+ const struct timespec *time,
struct weston_pointer_axis_event *event)
{
weston_pointer_send_axis(grab->pointer, time, event);
enum libinput_pointer_axis_source source;
uint32_t wl_axis_source;
bool has_vert, has_horiz;
+ struct timespec time;
has_vert = libinput_event_pointer_has_axis(pointer_event,
LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL);
notify_axis_source(device->seat, wl_axis_source);
+ timespec_from_usec(&time,
+ libinput_event_pointer_get_time_usec(pointer_event));
+
if (has_vert) {
axis = LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL;
vert_discrete = get_axis_discrete(pointer_event, axis);
weston_event.discrete = vert_discrete;
weston_event.has_discrete = (vert_discrete != 0);
- notify_axis(device->seat,
- libinput_event_pointer_get_time(pointer_event),
- &weston_event);
+ notify_axis(device->seat, &time, &weston_event);
}
if (has_horiz) {
weston_event.discrete = horiz_discrete;
weston_event.has_discrete = (horiz_discrete != 0);
- notify_axis(device->seat,
- libinput_event_pointer_get_time(pointer_event),
- &weston_event);
+ notify_axis(device->seat, &time, &weston_event);
}
return true;