Add unaccelerated pointer values to wlr_event_pointer_motion events
This commit is contained in:
parent
a803a007fb
commit
e276d310e8
|
@ -36,6 +36,8 @@ void handle_pointer_motion(struct libinput_event *event,
|
||||||
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
usec_to_msec(libinput_event_pointer_get_time_usec(pevent));
|
||||||
wlr_event.delta_x = libinput_event_pointer_get_dx(pevent);
|
wlr_event.delta_x = libinput_event_pointer_get_dx(pevent);
|
||||||
wlr_event.delta_y = libinput_event_pointer_get_dy(pevent);
|
wlr_event.delta_y = libinput_event_pointer_get_dy(pevent);
|
||||||
|
wlr_event.unaccel_dx = libinput_event_pointer_get_dx_unaccelerated(pevent);
|
||||||
|
wlr_event.unaccel_dy = libinput_event_pointer_get_dy_unaccelerated(pevent);
|
||||||
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion, &wlr_event);
|
wlr_signal_emit_safe(&wlr_dev->pointer->events.motion, &wlr_event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ struct wlr_event_pointer_motion {
|
||||||
struct wlr_input_device *device;
|
struct wlr_input_device *device;
|
||||||
uint32_t time_msec;
|
uint32_t time_msec;
|
||||||
double delta_x, delta_y;
|
double delta_x, delta_y;
|
||||||
|
double unaccel_dx, unaccel_dy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wlr_event_pointer_motion_absolute {
|
struct wlr_event_pointer_motion_absolute {
|
||||||
|
|
|
@ -331,9 +331,11 @@ void roots_cursor_handle_motion(struct roots_cursor *cursor,
|
||||||
double dx = event->delta_x;
|
double dx = event->delta_x;
|
||||||
double dy = event->delta_y;
|
double dy = event->delta_y;
|
||||||
|
|
||||||
/* TODO send unaccelerated values */
|
double unaccel_dx = event->unaccel_dx;
|
||||||
|
double unaccel_dy = event->unaccel_dy;
|
||||||
|
|
||||||
notify_relative_motion(cursor->seat,
|
notify_relative_motion(cursor->seat,
|
||||||
(uint64_t)event->time_msec * 1000, dx, dy, dx, dy);
|
(uint64_t)event->time_msec * 1000, dx, dy, unaccel_dx, unaccel_dy);
|
||||||
|
|
||||||
if (cursor->active_constraint) {
|
if (cursor->active_constraint) {
|
||||||
struct roots_view *view = cursor->pointer_view->view;
|
struct roots_view *view = cursor->pointer_view->view;
|
||||||
|
@ -377,7 +379,6 @@ void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor,
|
||||||
double dx = lx - cursor->cursor->x;
|
double dx = lx - cursor->cursor->x;
|
||||||
double dy = ly - cursor->cursor->y;
|
double dy = ly - cursor->cursor->y;
|
||||||
|
|
||||||
/* TODO send unaccelerated values */
|
|
||||||
notify_relative_motion(cursor->seat,
|
notify_relative_motion(cursor->seat,
|
||||||
(uint64_t)event->time_msec * 1000, dx, dy, dx, dy);
|
(uint64_t)event->time_msec * 1000, dx, dy, dx, dy);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue