mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-20 02:20:13 +01:00
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:
parent
d830ce962a
commit
613558e69e
1 changed files with 10 additions and 4 deletions
|
|
@ -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,
|
||||
struct weston_coord_global pos)
|
||||
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)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue