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 <ofour...@redhat.com>
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 <ofour...@redhat.com>
---
 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

Reply via email to