input: Pass axis events through pointer grab interfaces

Don't only send motions and buttons but also axis events through the
pointer grab interface.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-By: Derek Foreman <derekf@osg.samsung.com>
diff --git a/desktop-shell/shell.c b/desktop-shell/shell.c
index d507d18..52d1195 100644
--- a/desktop-shell/shell.c
+++ b/desktop-shell/shell.c
@@ -1701,6 +1701,12 @@
 }
 
 static void
+noop_grab_axis(struct weston_pointer_grab *grab,
+	       uint32_t time, uint32_t axis, wl_fixed_t value)
+{
+}
+
+static void
 constrain_position(struct weston_move_grab *move, int *cx, int *cy)
 {
 	struct shell_surface *shsurf = move->base.shsurf;
@@ -1782,6 +1788,7 @@
 	noop_grab_focus,
 	move_grab_motion,
 	move_grab_button,
+	noop_grab_axis,
 	move_grab_cancel,
 };
 
@@ -1945,6 +1952,7 @@
 	noop_grab_focus,
 	resize_grab_motion,
 	resize_grab_button,
+	noop_grab_axis,
 	resize_grab_cancel,
 };
 
@@ -2109,6 +2117,7 @@
 	busy_cursor_grab_focus,
 	busy_cursor_grab_motion,
 	busy_cursor_grab_button,
+	noop_grab_axis,
 	busy_cursor_grab_cancel,
 };
 
@@ -3291,6 +3300,19 @@
 }
 
 static void
+popup_grab_axis(struct weston_pointer_grab *grab,
+		uint32_t time, uint32_t axis, wl_fixed_t value)
+{
+	struct weston_pointer *pointer = grab->pointer;
+	struct wl_resource *resource;
+	struct wl_list *resource_list;
+
+	resource_list = &pointer->focus_resource_list;
+	wl_resource_for_each(resource, resource_list)
+		wl_pointer_send_axis(resource, time, axis, value);
+}
+
+static void
 popup_grab_cancel(struct weston_pointer_grab *grab)
 {
 	popup_grab_end(grab->pointer);
@@ -3300,6 +3322,7 @@
 	popup_grab_focus,
 	popup_grab_motion,
 	popup_grab_button,
+	popup_grab_axis,
 	popup_grab_cancel,
 };
 
@@ -5000,6 +5023,7 @@
 	noop_grab_focus,
 	rotate_grab_motion,
 	rotate_grab_button,
+	noop_grab_axis,
 	rotate_grab_cancel,
 };