Re: [PATCH libinput] touchpad: only pair internal trackpoint devices with internal touchpads

2015-04-15 Thread Peter Hutterer
fwiw, please don't do a reply to list only, it makes it harder to track
emails.

On Wed, Apr 15, 2015 at 07:17:35AM -0700, Bill Spitzak wrote:
> On 04/14/2015 09:01 PM, Peter Hutterer wrote:
> >Internal touchpads with trackpoints are either BUS_I8042 or BUS_I2C, but not
> >BUS_USB. Lenovo sells external keyboards with a trackpoint built-in, make 
> >sure
> >we don't pair that trackpoint with the internal touchpad.
> >And likewise, the internal trackpoint should not be paired with e.g. a wacom
> >touch device.
> >
> >Lenovo had one external device that has a trackpoint and a touchpad on an
> >external keyboard. That device won't be covered with this patch, if we have a
> >user we can re-consider.
> 
> Would checking if both devices are on the same bus (rather than not on the
> USB bus) work for the systems you have, and also cover this case?
> 
> (ie. use bus_tp == bus_trp instead of tp_is_internal && trp_is_internal)
> 
> Pardon me if I have no idea what I am talking about.

nah, good call, we had that idea too. there was the faint memory of some
synaptics device that couldn't handle the trackstick on i2c and went through
ps/2, so that may have broken this approach. in the end we went with this
approach since it that covered that (though possibly obsolete) case too.

Cheers,
   Peter

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput] touchpad: only pair internal trackpoint devices with internal touchpads

2015-04-15 Thread Bill Spitzak

On 04/14/2015 09:01 PM, Peter Hutterer wrote:

Internal touchpads with trackpoints are either BUS_I8042 or BUS_I2C, but not
BUS_USB. Lenovo sells external keyboards with a trackpoint built-in, make sure
we don't pair that trackpoint with the internal touchpad.
And likewise, the internal trackpoint should not be paired with e.g. a wacom
touch device.

Lenovo had one external device that has a trackpoint and a touchpad on an
external keyboard. That device won't be covered with this patch, if we have a
user we can re-consider.


Would checking if both devices are on the same bus (rather than not on 
the USB bus) work for the systems you have, and also cover this case?


(ie. use bus_tp == bus_trp instead of tp_is_internal && trp_is_internal)

Pardon me if I have no idea what I am talking about.

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


Re: [PATCH libinput] touchpad: only pair internal trackpoint devices with internal touchpads

2015-04-15 Thread Hans de Goede

Hi,

On 14-04-15 23:58, Peter Hutterer wrote:

Internal touchpads with trackpoints are either BUS_I8042 or BUS_I2C, but not
BUS_USB/BUS_BLUETOOTH. Lenovo sells external keyboards with a trackpoint
built-in, make sure we don't pair that trackpoint with the internal
touchpad. And likewise, an internal trackpoint should not be paired with
an external USB touchpad device (the current code pairs the trackpoint with
any Wacom touch device in addition to the normal touchpad pairing).

Lenovo had one external device that has a trackpoint and a touchpad on an
external keyboard. That device won't be covered with this patch, if we have a
user we can re-consider.

https://bugs.freedesktop.org/show_bug.cgi?id=89935

Signed-off-by: Peter Hutterer 


Looks good:

Reviewed-by: Hans de Goede 

Regards,

Hans


---
  src/evdev-mt-touchpad.c | 9 -
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a663db9..aa59869 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -825,9 +825,16 @@ tp_device_added(struct evdev_device *device,
struct evdev_device *added_device)
  {
struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch;
+   unsigned int bus_tp = libevdev_get_id_bustype(device->evdev),
+bus_trp = libevdev_get_id_bustype(added_device->evdev);
+   bool tp_is_internal, trp_is_internal;
+
+   tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH;
+   trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH;

if (tp->buttons.trackpoint == NULL &&
-   (added_device->tags & EVDEV_TAG_TRACKPOINT)) {
+   (added_device->tags & EVDEV_TAG_TRACKPOINT) &&
+   tp_is_internal && trp_is_internal) {
/* Don't send any pending releases to the new trackpoint */
tp->buttons.active_is_topbutton = false;
tp->buttons.trackpoint = added_device;


___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput] touchpad: only pair internal trackpoint devices with internal touchpads

2015-04-14 Thread Peter Hutterer
Internal touchpads with trackpoints are either BUS_I8042 or BUS_I2C, but not
BUS_USB/BUS_BLUETOOTH. Lenovo sells external keyboards with a trackpoint
built-in, make sure we don't pair that trackpoint with the internal
touchpad. And likewise, an internal trackpoint should not be paired with
an external USB touchpad device (the current code pairs the trackpoint with
any Wacom touch device in addition to the normal touchpad pairing).

Lenovo had one external device that has a trackpoint and a touchpad on an
external keyboard. That device won't be covered with this patch, if we have a
user we can re-consider.

https://bugs.freedesktop.org/show_bug.cgi?id=89935

Signed-off-by: Peter Hutterer 
---
 src/evdev-mt-touchpad.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a663db9..aa59869 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -825,9 +825,16 @@ tp_device_added(struct evdev_device *device,
struct evdev_device *added_device)
 {
struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch;
+   unsigned int bus_tp = libevdev_get_id_bustype(device->evdev),
+bus_trp = libevdev_get_id_bustype(added_device->evdev);
+   bool tp_is_internal, trp_is_internal;
+
+   tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH;
+   trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH;
 
if (tp->buttons.trackpoint == NULL &&
-   (added_device->tags & EVDEV_TAG_TRACKPOINT)) {
+   (added_device->tags & EVDEV_TAG_TRACKPOINT) &&
+   tp_is_internal && trp_is_internal) {
/* Don't send any pending releases to the new trackpoint */
tp->buttons.active_is_topbutton = false;
tp->buttons.trackpoint = added_device;
-- 
2.3.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH libinput] touchpad: only pair internal trackpoint devices with internal touchpads

2015-04-14 Thread Peter Hutterer
Internal touchpads with trackpoints are either BUS_I8042 or BUS_I2C, but not
BUS_USB. Lenovo sells external keyboards with a trackpoint built-in, make sure
we don't pair that trackpoint with the internal touchpad.
And likewise, the internal trackpoint should not be paired with e.g. a wacom
touch device.

Lenovo had one external device that has a trackpoint and a touchpad on an
external keyboard. That device won't be covered with this patch, if we have a
user we can re-consider.

https://bugs.freedesktop.org/show_bug.cgi?id=89935

Signed-off-by: Peter Hutterer 
---
Andreas: sorry about the duplicate, the first one never hit the list for
some reason.

 src/evdev-mt-touchpad.c | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index a663db9..aa59869 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -825,9 +825,16 @@ tp_device_added(struct evdev_device *device,
struct evdev_device *added_device)
 {
struct tp_dispatch *tp = (struct tp_dispatch*)device->dispatch;
+   unsigned int bus_tp = libevdev_get_id_bustype(device->evdev),
+bus_trp = libevdev_get_id_bustype(added_device->evdev);
+   bool tp_is_internal, trp_is_internal;
+
+   tp_is_internal = bus_tp != BUS_USB && bus_tp != BUS_BLUETOOTH;
+   trp_is_internal = bus_trp != BUS_USB && bus_trp != BUS_BLUETOOTH;
 
if (tp->buttons.trackpoint == NULL &&
-   (added_device->tags & EVDEV_TAG_TRACKPOINT)) {
+   (added_device->tags & EVDEV_TAG_TRACKPOINT) &&
+   tp_is_internal && trp_is_internal) {
/* Don't send any pending releases to the new trackpoint */
tp->buttons.active_is_topbutton = false;
tp->buttons.trackpoint = added_device;
-- 
2.3.4

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/wayland-devel