mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2025-12-27 23:10:07 +01:00
gestures: refactor gesture enabled
Move the condition to check if gestures are enabled to its own function. Signed-off-by: José Expósito <jose.exposito89@gmail.com>
This commit is contained in:
parent
bbc5aee5e5
commit
ba3e79c9f4
1 changed files with 7 additions and 1 deletions
|
|
@ -957,6 +957,12 @@ tp_gesture_handle_state(struct tp_dispatch *tp, uint64_t time)
|
|||
}
|
||||
}
|
||||
|
||||
static bool
|
||||
tp_gesture_are_gestures_enabled(struct tp_dispatch *tp)
|
||||
{
|
||||
return (!tp->semi_mt && tp->num_slots > 1);
|
||||
}
|
||||
|
||||
void
|
||||
tp_init_gesture(struct tp_dispatch *tp)
|
||||
{
|
||||
|
|
@ -965,7 +971,7 @@ tp_init_gesture(struct tp_dispatch *tp)
|
|||
/* two-finger scrolling is always enabled, this flag just
|
||||
* decides whether we detect pinch. semi-mt devices are too
|
||||
* unreliable to do pinch gestures. */
|
||||
tp->gesture.enabled = !tp->semi_mt && tp->num_slots > 1;
|
||||
tp->gesture.enabled = tp_gesture_are_gestures_enabled(tp);
|
||||
|
||||
tp->gesture.state = GESTURE_STATE_NONE;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue