compositor: Split pointer motion code into its own function
diff --git a/src/compositor.c b/src/compositor.c
index 6afc491..1ef0b54 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -1712,17 +1712,14 @@
}
}
-WL_EXPORT void
-notify_motion(struct weston_seat *seat, uint32_t time, wl_fixed_t x, wl_fixed_t y)
+static void
+move_pointer(struct weston_seat *seat, wl_fixed_t x, wl_fixed_t y)
{
- const struct wl_pointer_grab_interface *interface;
struct weston_compositor *ec = seat->compositor;
- struct weston_output *output;
struct wl_pointer *pointer = seat->seat.pointer;
+ struct weston_output *output;
int32_t ix, iy;
- weston_compositor_wake(ec);
-
clip_pointer_motion(seat, &x, &y);
weston_seat_update_drag_surface(seat, x - pointer->x, y - pointer->y);
@@ -1740,9 +1737,6 @@
weston_output_update_zoom(output, ZOOM_FOCUS_POINTER);
weston_device_repick(seat);
- interface = pointer->grab->interface;
- interface->motion(pointer->grab, time,
- pointer->grab->x, pointer->grab->y);
if (seat->sprite) {
weston_surface_set_position(seat->sprite,
@@ -1753,6 +1747,23 @@
}
WL_EXPORT void
+notify_motion(struct weston_seat *seat,
+ uint32_t time, wl_fixed_t x, wl_fixed_t y)
+{
+ const struct wl_pointer_grab_interface *interface;
+ struct weston_compositor *ec = seat->compositor;
+ struct wl_pointer *pointer = seat->seat.pointer;
+
+ weston_compositor_wake(ec);
+
+ move_pointer(seat, x, y);
+
+ interface = pointer->grab->interface;
+ interface->motion(pointer->grab, time,
+ pointer->grab->x, pointer->grab->y);
+}
+
+WL_EXPORT void
weston_surface_activate(struct weston_surface *surface,
struct weston_seat *seat)
{