Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-06-27 Thread Peter Hutterer
On Tue, Jun 11, 2013 at 12:07:10AM +0200, Sjoerd Simons wrote:
> On Fri, 2013-05-31 at 16:44 +1000, Peter Hutterer wrote:
> > On Fri, May 24, 2013 at 10:47:32PM +0200, Sjoerd Simons wrote:
> > > Attached is an updated version of the patch which prevents
> > > false-positives by checking whether a touchscreen device uses the wacom
> > > kernel driver (by checking the ID_USB_DRIVER property from udev)
> > 
> > Please see my reply to Ritesh in this thread:
> > http://old.nabble.com/Re%3A-libwacom-not-recognizing-touch%28screen%29-devices-p35313125.html
> > 
> > we have a device database of the devices we support - might as well use it
> > :)
> 
> Read that now (didn't see it before, i suck at searching the SF mail
> archives it seems), not sure if it makes much sense to me...
> 
> libwacom_new_from_path seems to roughly speaking work in two steps:
>  1: Get raw device information
>  2: lookup device in the database, and if found (or if WFALLBACK_GENERIC
> is given) create the WacomDevice struct.
> 
> What you seem to be suggesting is to fail getting the raw device
> information, in case the device is (practically speaking) a touchscreen
> that's not in the the database.. Which makes the semantics of
> WFALLBACK_GENERIC depend on the device type, which seems a bit odd.

not quite. what I'm suggesting is that if the device's vendor/product ID
matches one we already have in the DB we don't rely on the raw device
information anyway. e.g. if your DB says that 0x56a:00c6 is a Cintiq 12WX
we _know_ the device is a built-in tablet. that's what the db is for.

if a device is not in the database, then we need to guess and create the
generic device. in your case, the x220t should be in the database, it's the
0xe6 device so there is no reason we should fail.

where it's failing now is that if the device doesn't have the udev tags set
we don't look at it at all, even though the device may be in the db and thus
supported by libwacom.

> But if that's what you would like to see (Only do the WFALLBACK_GENERIC
> fallback for touchpads and non-integrated tablets), i'm happy to provide
> a patch that does that explicitly which seems nicer then having
> get_device_info pre-check the database :)
> 
> 
> Btw, checking whether the wacom driver is used instead of the database
> has the advantage something like g-s-d which uses WFALLBACK_GENERIC
> still works when one has a recent kernel which recognizes a new device
> but an older libwacom database.

true, but that would be on top of the other thing. also, we could assume
that anything with vendor id 056a is a wacom device which is probably better
than checking the kernel driver :)

Cheers,
   Peter


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-06-10 Thread Sjoerd Simons
On Fri, 2013-05-31 at 16:44 +1000, Peter Hutterer wrote:
> On Fri, May 24, 2013 at 10:47:32PM +0200, Sjoerd Simons wrote:
> > Attached is an updated version of the patch which prevents
> > false-positives by checking whether a touchscreen device uses the wacom
> > kernel driver (by checking the ID_USB_DRIVER property from udev)
> 
> Please see my reply to Ritesh in this thread:
> http://old.nabble.com/Re%3A-libwacom-not-recognizing-touch%28screen%29-devices-p35313125.html
> 
> we have a device database of the devices we support - might as well use it
> :)

Read that now (didn't see it before, i suck at searching the SF mail
archives it seems), not sure if it makes much sense to me...

libwacom_new_from_path seems to roughly speaking work in two steps:
 1: Get raw device information
 2: lookup device in the database, and if found (or if WFALLBACK_GENERIC
is given) create the WacomDevice struct.

What you seem to be suggesting is to fail getting the raw device
information, in case the device is (practically speaking) a touchscreen
that's not in the the database.. Which makes the semantics of
WFALLBACK_GENERIC depend on the device type, which seems a bit odd.

But if that's what you would like to see (Only do the WFALLBACK_GENERIC
fallback for touchpads and non-integrated tablets), i'm happy to provide
a patch that does that explicitly which seems nicer then having
get_device_info pre-check the database :)


Btw, checking whether the wacom driver is used instead of the database
has the advantage something like g-s-d which uses WFALLBACK_GENERIC
still works when one has a recent kernel which recognizes a new device
but an older libwacom database.

-- 
Sjoerd Simons 

--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-05-30 Thread Peter Hutterer
On Fri, May 24, 2013 at 10:47:32PM +0200, Sjoerd Simons wrote:
> On Tue, 2013-04-16 at 10:35 +1000, Peter Hutterer wrote:
> > On Mon, Mar 25, 2013 at 09:22:20AM +0100, Sjoerd Simons wrote:
> > > Making libwacom recognize the touch
> > > device as a wacom device solves this issue (As it makes gnome set the
> > > wacom rotation for it)
> > 
> > sorry, too simple a fix and too many wide-reaching consequences. we'll need
> > something a lot narrower than this.
> > 
> > http://sourceforge.net/mailarchive/forum.php?thread_name=CAGK%2BT_%3DiyfZKXCUJ4jFChy%2Bb0U3%3DGbfMMAJVY%2BQ2aVkiZnusMQ%40mail.gmail.com&forum_name=linuxwacom-devel
> 
> Looking as Bastiens example the problem is calling
> libwacom_new_from_path with WFALLBACK_GENERIC, which always creates a
> device if it doesn't know the model.. The same problem would occur with
> tablets from a vendor that's not wacom. There just aren't that many of
> those vs. non-wacom touchscreens :).
> 
> Attached is an updated version of the patch which prevents
> false-positives by checking whether a touchscreen device uses the wacom
> kernel driver (by checking the ID_USB_DRIVER property from udev)

Please see my reply to Ritesh in this thread:
http://old.nabble.com/Re%3A-libwacom-not-recognizing-touch%28screen%29-devices-p35313125.html

we have a device database of the devices we support - might as well use it
:)

Cheers,
   Peter


> From ea0c25e80b817ede87fa2ad38017d05d69ea7c7a Mon Sep 17 00:00:00 2001
> From: Sjoerd Simons 
> Date: Mon, 25 Mar 2013 09:08:53 +0100
> Subject: [PATCH] Also recognize touchscreen wacom devices
> 
> On my X220t there are two wacom device exposed. One being the pen and
> one being two finger touch. The touch device has ID_INPUT_TOUCHSCREEN
> instead of _TABLET or _TOUCHPAD, so also recognize that.
> 
> To prevent false-negatives only recognize touchscreen that use the wacom
> usb driver
> 
> Signed-off-by: Sjoerd Simons 
> ---
>  libwacom/libwacom.c |4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 1b9b398..b4afe56 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -56,6 +56,10 @@ libwacom_get_device(const WacomDeviceDatabase *db, const 
> char *match)
>  static gboolean
>  is_tablet_or_touchpad (GUdevDevice *device)
>  {
> + if (g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TOUCHSCREEN"))
> + return !g_strcmp0 ("wacom", g_udev_device_get_property (device,
> + "ID_USB_DRIVER"));
> +
>   return g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TABLET") ||
>   g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TOUCHPAD");
>  }
> -- 
> 1.7.10.4
> 


--
Get 100% visibility into Java/.NET code with AppDynamics Lite
It's a free troubleshooting tool designed for production
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://p.sf.net/sfu/appdyn_d2d_ap2
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-05-24 Thread Sjoerd Simons
On Tue, 2013-04-16 at 10:35 +1000, Peter Hutterer wrote:
> On Mon, Mar 25, 2013 at 09:22:20AM +0100, Sjoerd Simons wrote:
> > Making libwacom recognize the touch
> > device as a wacom device solves this issue (As it makes gnome set the
> > wacom rotation for it)
> 
> sorry, too simple a fix and too many wide-reaching consequences. we'll need
> something a lot narrower than this.
> 
> http://sourceforge.net/mailarchive/forum.php?thread_name=CAGK%2BT_%3DiyfZKXCUJ4jFChy%2Bb0U3%3DGbfMMAJVY%2BQ2aVkiZnusMQ%40mail.gmail.com&forum_name=linuxwacom-devel

Looking as Bastiens example the problem is calling
libwacom_new_from_path with WFALLBACK_GENERIC, which always creates a
device if it doesn't know the model.. The same problem would occur with
tablets from a vendor that's not wacom. There just aren't that many of
those vs. non-wacom touchscreens :).

Attached is an updated version of the patch which prevents
false-positives by checking whether a touchscreen device uses the wacom
kernel driver (by checking the ID_USB_DRIVER property from udev)

-- 
Sjoerd Simons 
From ea0c25e80b817ede87fa2ad38017d05d69ea7c7a Mon Sep 17 00:00:00 2001
From: Sjoerd Simons 
Date: Mon, 25 Mar 2013 09:08:53 +0100
Subject: [PATCH] Also recognize touchscreen wacom devices

On my X220t there are two wacom device exposed. One being the pen and
one being two finger touch. The touch device has ID_INPUT_TOUCHSCREEN
instead of _TABLET or _TOUCHPAD, so also recognize that.

To prevent false-negatives only recognize touchscreen that use the wacom
usb driver

Signed-off-by: Sjoerd Simons 
---
 libwacom/libwacom.c |4 
 1 file changed, 4 insertions(+)

diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 1b9b398..b4afe56 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -56,6 +56,10 @@ libwacom_get_device(const WacomDeviceDatabase *db, const char *match)
 static gboolean
 is_tablet_or_touchpad (GUdevDevice *device)
 {
+	if (g_udev_device_get_property_as_boolean (device, "ID_INPUT_TOUCHSCREEN"))
+		return !g_strcmp0 ("wacom", g_udev_device_get_property (device,
+			"ID_USB_DRIVER"));
+
 	return g_udev_device_get_property_as_boolean (device, "ID_INPUT_TABLET") ||
 		g_udev_device_get_property_as_boolean (device, "ID_INPUT_TOUCHPAD");
 }
-- 
1.7.10.4

--
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-04-18 Thread Peter Hutterer
On Tue, Apr 16, 2013 at 11:53:11AM +0530, Ritesh Khadgaray wrote:
>  Let me know, if this would work fine ?

close, though I'd like to see few changes here. first, I think
is_supported_device() is a better name, it's more general. 

And the logic should check not just the wacom driver but rather
vendor/product against the db. if we have v/p combination in the database we
explicitly support it, regardless of the ID_INPUT* tags.

so a solution would be to extract product/vendor first; or to use
is_tablet_touchpad() as a quick check and then go into the more extensive db
check if it fails.

so the flow is something like this:

if (!is_tablet_or_touchpad)
   int p, v = get_vendor_product_id();
   if p, v in database
  continue with device

Cheers,
   Peter

> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 1b9b398..29ffcc0 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -54,10 +54,13 @@ libwacom_get_device(const WacomDeviceDatabase *db, const 
> char *match)
>  }
>  
>  static gboolean
> -is_tablet_or_touchpad (GUdevDevice *device)
> +is_useable_device (GUdevDevice *device)

>  {
> + gboolean is_wacom = (g_strcmp0 ("wacom", 
> g_udev_device_get_property(device,"ID_USB_DRIVER")) == 0 );
> + 
>   return g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TABLET") ||
> - g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TOUCHPAD");
> + g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TOUCHPAD") ||
> + is_wacom ? g_udev_device_get_property_as_boolean(device, 
> "ID_INPUT_TOUCHSCREEN"): 0 ;
>  }
>  
>  /* Overriding SUBSYSTEM isn't allowed in udev (works sometimes, but not
> @@ -154,11 +157,11 @@ get_device_info (const char*path,
>   }
>  
>   /* Touchpads are only for the "Finger" part of Bamboo devices */
> - if (!is_tablet_or_touchpad(device)) {
> + if (!is_useable_device(device)) {
>   GUdevDevice *parent;
>  
>   parent = g_udev_device_get_parent(device);
> - if (!parent || !is_tablet_or_touchpad(parent)) {
> + if (!parent || !is_useable_device(parent)) {
>   libwacom_error_set(error, WERROR_INVALID_PATH, "Device 
> '%s' is not a tablet", path);
>   g_object_unref (parent);
>   goto bail;

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-04-15 Thread Ritesh Khadgaray

Hi


 Let me know, if this would work fine ?
  

reference: https://sourceforge.net/p/linuxwacom/bugs/227/

-- 
 --ritz
(paradoxum)
%
  Most bacteria have the decency to be microscopic. Epulopiscium
  fishelsoni is not among them. The newly identified one-celled
  macro-microorganism is a full .5 mm long, large enough to be seen
  with the naked eye. Described in the current Nature, "It is a
  million times as massive as a typical bacterium."-Time, page 25,
  March 29, 1993
diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 1b9b398..29ffcc0 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -54,10 +54,13 @@ libwacom_get_device(const WacomDeviceDatabase *db, const char *match)
 }
 
 static gboolean
-is_tablet_or_touchpad (GUdevDevice *device)
+is_useable_device (GUdevDevice *device)
 {
+	gboolean is_wacom = (g_strcmp0 ("wacom", g_udev_device_get_property(device,"ID_USB_DRIVER")) == 0 );
+	
 	return g_udev_device_get_property_as_boolean (device, "ID_INPUT_TABLET") ||
-		g_udev_device_get_property_as_boolean (device, "ID_INPUT_TOUCHPAD");
+		g_udev_device_get_property_as_boolean (device, "ID_INPUT_TOUCHPAD") ||
+		is_wacom ? g_udev_device_get_property_as_boolean(device, "ID_INPUT_TOUCHSCREEN"): 0 ;
 }
 
 /* Overriding SUBSYSTEM isn't allowed in udev (works sometimes, but not
@@ -154,11 +157,11 @@ get_device_info (const char*path,
 	}
 
 	/* Touchpads are only for the "Finger" part of Bamboo devices */
-	if (!is_tablet_or_touchpad(device)) {
+	if (!is_useable_device(device)) {
 		GUdevDevice *parent;
 
 		parent = g_udev_device_get_parent(device);
-		if (!parent || !is_tablet_or_touchpad(parent)) {
+		if (!parent || !is_useable_device(parent)) {
 			libwacom_error_set(error, WERROR_INVALID_PATH, "Device '%s' is not a tablet", path);
 			g_object_unref (parent);
 			goto bail;
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


Re: [Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-04-15 Thread Peter Hutterer
On Mon, Mar 25, 2013 at 09:22:20AM +0100, Sjoerd Simons wrote:
> Hey,
> 
> When playing with the latest gnome on an X220t i noticed that the pen
> input on the built-in tablet nicely follows the rotation of the screen
> but the finger touch input does not. Making libwacom recognize the touch
> device as a wacom device solves this issue (As it makes gnome set the
> wacom rotation for it)

sorry, too simple a fix and too many wide-reaching consequences. we'll need
something a lot narrower than this.

http://sourceforge.net/mailarchive/forum.php?thread_name=CAGK%2BT_%3DiyfZKXCUJ4jFChy%2Bb0U3%3DGbfMMAJVY%2BQ2aVkiZnusMQ%40mail.gmail.com&forum_name=linuxwacom-devel

Cheers,
   Peter
 
> From 69beb7e641950168ac26643048fef938194d77f8 Mon Sep 17 00:00:00 2001
> From: Sjoerd Simons 
> Date: Mon, 25 Mar 2013 09:08:53 +0100
> Subject: [PATCH] Also recognize touchscreen wacom devices
> 
> On my X220t there are two wacom device exposed. One being the pen and
> one being two finger touch. The touch device has ID_INPUT_TOUCHSCREEN
> instead of _TABLET or _TOUCHPAD, so also recognize that.
> 
> Signed-off-by: Sjoerd Simons 
> ---
>  libwacom/libwacom.c |1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
> index 1b9b398..0f44eb2 100644
> --- a/libwacom/libwacom.c
> +++ b/libwacom/libwacom.c
> @@ -57,6 +57,7 @@ static gboolean
>  is_tablet_or_touchpad (GUdevDevice *device)
>  {
>   return g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TABLET") ||
> + g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TOUCHSCREEN") ||
>   g_udev_device_get_property_as_boolean (device, 
> "ID_INPUT_TOUCHPAD");
>  }
>  
> -- 
> 1.7.10.4
> 

> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_d2d_mar

> ___
> Linuxwacom-devel mailing list
> Linuxwacom-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel


[Linuxwacom-devel] libwacom not recognizing touch(screen) devices

2013-03-25 Thread Sjoerd Simons
Hey,

When playing with the latest gnome on an X220t i noticed that the pen
input on the built-in tablet nicely follows the rotation of the screen
but the finger touch input does not. Making libwacom recognize the touch
device as a wacom device solves this issue (As it makes gnome set the
wacom rotation for it)

Patch attached

-- 
Sjoerd Simons 
From 69beb7e641950168ac26643048fef938194d77f8 Mon Sep 17 00:00:00 2001
From: Sjoerd Simons 
Date: Mon, 25 Mar 2013 09:08:53 +0100
Subject: [PATCH] Also recognize touchscreen wacom devices

On my X220t there are two wacom device exposed. One being the pen and
one being two finger touch. The touch device has ID_INPUT_TOUCHSCREEN
instead of _TABLET or _TOUCHPAD, so also recognize that.

Signed-off-by: Sjoerd Simons 
---
 libwacom/libwacom.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c
index 1b9b398..0f44eb2 100644
--- a/libwacom/libwacom.c
+++ b/libwacom/libwacom.c
@@ -57,6 +57,7 @@ static gboolean
 is_tablet_or_touchpad (GUdevDevice *device)
 {
 	return g_udev_device_get_property_as_boolean (device, "ID_INPUT_TABLET") ||
+		g_udev_device_get_property_as_boolean (device, "ID_INPUT_TOUCHSCREEN") ||
 		g_udev_device_get_property_as_boolean (device, "ID_INPUT_TOUCHPAD");
 }
 
-- 
1.7.10.4

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_mar___
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel