Re: [Linuxwacom-devel] libwacom: [PATCH] lib: use integration flags from device info
On Mon, Dec 03, 2012 at 10:53:31AM +0100, Olivier Fourdan wrote: > Resend, sorry the commit message was the opposite of what I meant... > >From 378edbc1b5caec1e27164d33dd4135a38b32f003 Mon Sep 17 00:00:00 2001 > From: Olivier Fourdan > Date: Mon, 3 Dec 2012 10:25:11 +0100 > Subject: [PATCH] lib: use integration flags from device info > > if and only if the entry in the database did not set > a value. > > The flags set in the database entry should not be changed > based on kernel flags unless the database did not set the > integration flags. > merged, thanks Cheers, Peter > Signed-off-by: Olivier Fourdan > --- > libwacom/libwacom.c |8 > 1 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c > index 23f3b08..7e88148 100644 > --- a/libwacom/libwacom.c > +++ b/libwacom/libwacom.c > @@ -142,6 +142,7 @@ get_device_info (const char*path, > g_type_init(); > > retval = FALSE; > + /* The integration flags from device info are unset by default */ > *integration_flags = WACOM_DEVICE_INTEGRATED_UNSET; > *name = NULL; > bus_str = NULL; > @@ -507,10 +508,9 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const > char *path, WacomFallbackF > libwacom_update_match(ret, bus, vendor_id, product_id); > > if (device) { > - if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY) > - ret->integration_flags |= > WACOM_DEVICE_INTEGRATED_DISPLAY; > - else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE) > - ret->integration_flags &= > ~WACOM_DEVICE_INTEGRATED_DISPLAY; > + /* if unset, use the kernel flags. Could be uset as well. */ > + if (ret->integration_flags == WACOM_DEVICE_INTEGRATED_UNSET) > + ret->integration_flags = integration_flags; > > return ret; > } > -- > 1.7.1 > -- LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d ___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
[Linuxwacom-devel] libwacom: [PATCH] lib: use integration flags from device info
Resend, sorry the commit message was the opposite of what I meant... >From 378edbc1b5caec1e27164d33dd4135a38b32f003 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 3 Dec 2012 10:25:11 +0100 Subject: [PATCH] lib: use integration flags from device info if and only if the entry in the database did not set a value. The flags set in the database entry should not be changed based on kernel flags unless the database did not set the integration flags. Signed-off-by: Olivier Fourdan --- libwacom/libwacom.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c index 23f3b08..7e88148 100644 --- a/libwacom/libwacom.c +++ b/libwacom/libwacom.c @@ -142,6 +142,7 @@ get_device_info (const char*path, g_type_init(); retval = FALSE; + /* The integration flags from device info are unset by default */ *integration_flags = WACOM_DEVICE_INTEGRATED_UNSET; *name = NULL; bus_str = NULL; @@ -507,10 +508,9 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, WacomFallbackF libwacom_update_match(ret, bus, vendor_id, product_id); if (device) { - if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY) - ret->integration_flags |= WACOM_DEVICE_INTEGRATED_DISPLAY; - else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE) - ret->integration_flags &= ~WACOM_DEVICE_INTEGRATED_DISPLAY; + /* if unset, use the kernel flags. Could be uset as well. */ + if (ret->integration_flags == WACOM_DEVICE_INTEGRATED_UNSET) + ret->integration_flags = integration_flags; return ret; } -- 1.7.1 -- Keep yourself connected to Go Parallel: BUILD Helping you discover the best ways to construct your parallel projects. http://goparallel.sourceforge.net___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel
[Linuxwacom-devel] libwacom: [PATCH] lib: use integration flags from device info
Following the comments from Peter regarding /not/ changing the integration flags when set in the database. >From 63808789de413dc4ea60fadc7bb897cc870b008d Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Mon, 3 Dec 2012 10:25:11 +0100 Subject: [PATCH] lib: use integration flags from device info if and only if the entry in the database did not set a value. The flags set in the database entry should be changed based on kernel flags unless the database did not set the integration flags. Signed-off-by: Olivier Fourdan --- libwacom/libwacom.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c index 23f3b08..7e88148 100644 --- a/libwacom/libwacom.c +++ b/libwacom/libwacom.c @@ -142,6 +142,7 @@ get_device_info (const char*path, g_type_init(); retval = FALSE; + /* The integration flags from device info are unset by default */ *integration_flags = WACOM_DEVICE_INTEGRATED_UNSET; *name = NULL; bus_str = NULL; @@ -507,10 +508,9 @@ libwacom_new_from_path(WacomDeviceDatabase *db, const char *path, WacomFallbackF libwacom_update_match(ret, bus, vendor_id, product_id); if (device) { - if (integration_flags == WACOM_DEVICE_INTEGRATED_DISPLAY) - ret->integration_flags |= WACOM_DEVICE_INTEGRATED_DISPLAY; - else if (integration_flags == WACOM_DEVICE_INTEGRATED_NONE) - ret->integration_flags &= ~WACOM_DEVICE_INTEGRATED_DISPLAY; + /* if unset, use the kernel flags. Could be uset as well. */ + if (ret->integration_flags == WACOM_DEVICE_INTEGRATED_UNSET) + ret->integration_flags = integration_flags; return ret; } -- 1.7.1 -- Keep yourself connected to Go Parallel: BUILD Helping you discover the best ways to construct your parallel projects. http://goparallel.sourceforge.net___ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel