input: refactor weston_pointer_move_to

Pull the clamping out and expose an internal pre-clamped function, which
will be used elsewhere in a later commit.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2025-12-10 10:19:03 -06:00 committed by Marius Vlad
parent d830ce962a
commit 613558e69e

View file

@ -521,11 +521,9 @@ weston_pointer_clamp(struct weston_pointer *pointer, struct weston_coord_global
}
static void
weston_pointer_move_to(struct weston_pointer *pointer,
weston_pointer_move_to_preclamped(struct weston_pointer *pointer,
struct weston_coord_global pos)
{
pos = weston_pointer_clamp(pointer, pos);
pointer->pos = pos;
if (pointer->sprite) {
@ -540,6 +538,14 @@ weston_pointer_move_to(struct weston_pointer *pointer,
wl_signal_emit(&pointer->motion_signal, pointer);
}
static void
weston_pointer_move_to(struct weston_pointer *pointer,
struct weston_coord_global pos)
{
pos = weston_pointer_clamp(pointer, pos);
weston_pointer_move_to_preclamped(pointer, pos);
}
WL_EXPORT void
weston_pointer_move(struct weston_pointer *pointer,
struct weston_pointer_motion_event *event)