diff options
author | Jonas Ådahl <jadahl@gmail.com> | 2016-09-13 15:16:57 +0800 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2016-10-05 13:46:29 -0400 |
commit | 0fae3be0686cae746e03d6e4592f97278cc2275d (patch) | |
tree | 562b2be8d8663cee3156596488c815f3974ba380 /dix | |
parent | bbd4854f81ebba1119202c5f6ff4679c62afec1f (diff) |
dix: Add valuator_mask_set_absolute_unaccelerated
Add a valuator mask setter for setting absolute coordinate combined
with unaccelerated motion deltas. This will later be used by Xwayland
to combine a wl_pointer.motion() event with the unaccelerated delta of
a wp_relative_pointer.relative_motion() event.
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r-- | dix/inpututils.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/dix/inpututils.c b/dix/inpututils.c index 5b7da3ab2..6bff9efab 100644 --- a/dix/inpututils.c +++ b/dix/inpututils.c @@ -636,6 +636,19 @@ valuator_mask_drop_unaccelerated(ValuatorMask *mask) mask->has_unaccelerated = FALSE; } +void +valuator_mask_set_absolute_unaccelerated(ValuatorMask *mask, + int valuator, + int absolute, + double unaccel) +{ + BUG_WARN_MSG(mask->last_bit != -1 && !mask->has_unaccelerated, + "Do not mix valuator types, zero mask first\n"); + _valuator_mask_set_double(mask, valuator, absolute); + mask->has_unaccelerated = TRUE; + mask->unaccelerated[valuator] = unaccel; +} + /** * Set both accelerated and unaccelerated value for this mask. */ |