Add a weston_pointer_axis_event
Use an event struct to pass axis events around. This helps dealing with the
upcoming axis discrete changes.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c
index 1bf744c..d6d2fa1 100644
--- a/src/compositor-rdp.c
+++ b/src/compositor-rdp.c
@@ -971,6 +971,8 @@
}
if (flags & PTR_FLAGS_WHEEL) {
+ struct weston_pointer_axis_event weston_event;
+
/* DEFAULT_AXIS_STEP_DISTANCE is stolen from compositor-x11.c
* The RDP specs says the lower bits of flags contains the "the number of rotation
* units the mouse wheel was rotated".
@@ -981,9 +983,11 @@
if (flags & PTR_FLAGS_WHEEL_NEGATIVE)
axis = -axis;
+ weston_event.axis = WL_POINTER_AXIS_VERTICAL_SCROLL;
+ weston_event.value = axis;
+
notify_axis(&peerContext->item.seat, weston_compositor_get_time(),
- WL_POINTER_AXIS_VERTICAL_SCROLL,
- axis);
+ &weston_event);
}
FREERDP_CB_RETURN(TRUE);