mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-05 06:20:26 +01:00
touchpad: rename real_touches to num_slots
Less ambiguous since real_touches can be interpreted to "current number of real touches as opposed to fake touches". Which it isn't, this variable holds the number of slots. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Hans de Goede <hdegoede@redhat.com>
This commit is contained in:
parent
753d68aaa7
commit
44ce633bff
3 changed files with 7 additions and 7 deletions
|
|
@ -39,7 +39,7 @@ tp_get_touches_delta(struct tp_dispatch *tp, bool average)
|
|||
struct normalized_coords normalized;
|
||||
struct normalized_coords delta = {0.0, 0.0};
|
||||
|
||||
for (i = 0; i < tp->real_touches; i++) {
|
||||
for (i = 0; i < tp->num_slots; i++) {
|
||||
t = &tp->touches[i];
|
||||
|
||||
if (tp_touch_active(tp, t) && t->dirty) {
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ tp_process_fake_touches(struct tp_dispatch *tp,
|
|||
if (nfake_touches == FAKE_FINGER_OVERFLOW)
|
||||
return;
|
||||
|
||||
start = tp->has_mt ? tp->real_touches : 0;
|
||||
start = tp->has_mt ? tp->num_slots : 0;
|
||||
for (i = start; i < tp->ntouches; i++) {
|
||||
t = tp_get_touch(tp, i);
|
||||
if (i < nfake_touches)
|
||||
|
|
@ -577,7 +577,7 @@ tp_process_state(struct tp_dispatch *tp, uint64_t time)
|
|||
if (tp->semi_mt && tp->nfingers_down != tp->old_nfingers_down)
|
||||
tp_motion_history_reset(t);
|
||||
|
||||
if (i >= tp->real_touches && t->state != TOUCH_NONE) {
|
||||
if (i >= tp->num_slots && t->state != TOUCH_NONE) {
|
||||
t->point = first->point;
|
||||
if (!t->dirty)
|
||||
t->dirty = first->dirty;
|
||||
|
|
@ -938,11 +938,11 @@ tp_init_slots(struct tp_dispatch *tp,
|
|||
|
||||
absinfo = libevdev_get_abs_info(device->evdev, ABS_MT_SLOT);
|
||||
if (absinfo) {
|
||||
tp->real_touches = absinfo->maximum + 1;
|
||||
tp->num_slots = absinfo->maximum + 1;
|
||||
tp->slot = absinfo->value;
|
||||
tp->has_mt = true;
|
||||
} else {
|
||||
tp->real_touches = 1;
|
||||
tp->num_slots = 1;
|
||||
tp->slot = 0;
|
||||
tp->has_mt = false;
|
||||
}
|
||||
|
|
@ -958,7 +958,7 @@ tp_init_slots(struct tp_dispatch *tp,
|
|||
}
|
||||
}
|
||||
|
||||
tp->ntouches = max(tp->real_touches, n_btn_tool_touches);
|
||||
tp->ntouches = max(tp->num_slots, n_btn_tool_touches);
|
||||
tp->touches = calloc(tp->ntouches, sizeof(struct tp_touch));
|
||||
if (!tp->touches)
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ struct tp_dispatch {
|
|||
bool semi_mt;
|
||||
enum touchpad_model model;
|
||||
|
||||
unsigned int real_touches; /* number of slots */
|
||||
unsigned int num_slots; /* number of slots */
|
||||
unsigned int ntouches; /* no slots inc. fakes */
|
||||
struct tp_touch *touches; /* len == ntouches */
|
||||
/* bit 0: BTN_TOUCH
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue