diff options
| author | Peter Hutterer <peter.hutterer@who-t.net> | 2015-06-24 11:41:47 +1000 |
|---|---|---|
| committer | Peter Hutterer <peter.hutterer@who-t.net> | 2015-07-01 08:57:18 +1000 |
| commit | f0c8286ae83fc7a69f56e7d87be8938aba75aa6f (patch) | |
| tree | 4515d7c6f5e91affd63db6a8c042464fee58f6fd /src | |
| parent | eb4bd799de2f91120c43c91fb3dd8942f16f3659 (diff) | |
| download | libinput-f0c8286ae83fc7a69f56e7d87be8938aba75aa6f.tar.gz | |
touchpad: disable trackpoint palm detection on small touchpads
Tested on three laptops here, Lenovo T61, X220 and an HP EliteBook (?), all
with small touchpads. It's hard to have a hand position where the palm touches
the touchpad while using the trackpoint. So we might as well save us the
effort of monitoring events and enabling/disabling it on demand.
As a side-effect this fixes 1233844, but that's more a coincidence.
https://bugzilla.redhat.com/show_bug.cgi?id=1233844
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/evdev-mt-touchpad.c | 20 | ||||
| -rw-r--r-- | src/evdev-mt-touchpad.h | 1 |
2 files changed, 15 insertions, 6 deletions
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c index 538c2d77..24743406 100644 --- a/src/evdev-mt-touchpad.c +++ b/src/evdev-mt-touchpad.c @@ -520,6 +520,9 @@ tp_palm_detect_trackpoint(struct tp_dispatch *tp, struct tp_touch *t, uint64_t time) { + if (!tp->palm.monitor_trackpoint) + return 0; + if (t->palm.state == PALM_NONE && t->state == TOUCH_BEGIN && tp->palm.trackpoint_active) { @@ -844,7 +847,8 @@ tp_remove_sendevents(struct tp_dispatch *tp) libinput_timer_cancel(&tp->palm.trackpoint_timer); libinput_timer_cancel(&tp->dwt.keyboard_timer); - if (tp->buttons.trackpoint) + if (tp->buttons.trackpoint && + tp->palm.monitor_trackpoint) libinput_device_remove_event_listener( &tp->palm.trackpoint_listener); @@ -1109,9 +1113,10 @@ tp_interface_device_added(struct evdev_device *device, /* Don't send any pending releases to the new trackpoint */ tp->buttons.active_is_topbutton = false; tp->buttons.trackpoint = added_device; - libinput_device_add_event_listener(&added_device->base, - &tp->palm.trackpoint_listener, - tp_trackpoint_event, tp); + if (tp->palm.monitor_trackpoint) + libinput_device_add_event_listener(&added_device->base, + &tp->palm.trackpoint_listener, + tp_trackpoint_event, tp); } if (added_device->tags & EVDEV_TAG_KEYBOARD && @@ -1150,8 +1155,9 @@ tp_interface_device_removed(struct evdev_device *device, tp->buttons.active = 0; tp->buttons.active_is_topbutton = false; } - libinput_device_remove_event_listener( - &tp->palm.trackpoint_listener); + if (tp->palm.monitor_trackpoint) + libinput_device_remove_event_listener( + &tp->palm.trackpoint_listener); tp->buttons.trackpoint = NULL; } @@ -1455,6 +1461,8 @@ tp_init_palmdetect(struct tp_dispatch *tp, tp->palm.left_edge = device->abs.absinfo_x->minimum + width * 0.05; tp->palm.vert_center = device->abs.absinfo_y->minimum + height/2; + tp->palm.monitor_trackpoint = true; + return 0; } diff --git a/src/evdev-mt-touchpad.h b/src/evdev-mt-touchpad.h index f3c2bf7a..2466dab5 100644 --- a/src/evdev-mt-touchpad.h +++ b/src/evdev-mt-touchpad.h @@ -283,6 +283,7 @@ struct tp_dispatch { struct libinput_event_listener trackpoint_listener; struct libinput_timer trackpoint_timer; uint64_t trackpoint_last_event_time; + bool monitor_trackpoint; } palm; struct { |
