Blame SOURCES/0002-Allocate-4-buttons-for-stylus-devices-Pro-Pen-3D.patch

7f8e34
From 685850060f1cef064a90e02191d4732f275c7179 Mon Sep 17 00:00:00 2001
7f8e34
From: Jason Gerecke <killertofu@gmail.com>
7f8e34
Date: Tue, 26 Dec 2017 14:21:17 -0800
7f8e34
Subject: [PATCH] Allocate 4 buttons for stylus devices (Pro Pen 3D)
7f8e34
7f8e34
The Pro Pen 3D includes a third stylus button, reported from the kernel
7f8e34
as BTN_STYLUS3. Support for this event was added earlier, but the number
7f8e34
of buttons allocated was not updated. This meant that although the X
7f8e34
driver would properly set the button flag bit to indicate that a button
7f8e34
should be sent, a userspace event wouldn't actually be sent. This commit
7f8e34
increases the number of buttons allocated, causing the third button to
7f8e34
emit X11 button number 8 when pressed. This button can also be configured
7f8e34
through xsetwacom now that the driver allocates the correct number.
7f8e34
7f8e34
Fixes: 4a96a58f26 ("Add support for kernel's new BTN_STYLUS3 event")
7f8e34
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
7f8e34
Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
7f8e34
---
7f8e34
 src/wcmUSB.c | 4 ++--
7f8e34
 1 file changed, 2 insertions(+), 2 deletions(-)
7f8e34
7f8e34
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
7f8e34
index 9190fbe..1e4dc51 100644
7f8e34
--- a/src/wcmUSB.c
7f8e34
+++ b/src/wcmUSB.c
7f8e34
@@ -167,7 +167,7 @@ static unsigned short padkey_codes [] = {
7f8e34
 /* Fixed mapped stylus and mouse buttons */
7f8e34
 
7f8e34
 #define WCM_USB_MAX_MOUSE_BUTTONS 5
7f8e34
-#define WCM_USB_MAX_STYLUS_BUTTONS 3
7f8e34
+#define WCM_USB_MAX_STYLUS_BUTTONS 4
7f8e34
 
7f8e34
 static unsigned short mouse_codes [] = {
7f8e34
 	BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_BACK, BTN_FORWARD,
7f8e34
@@ -480,7 +480,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, size_t id_len, float *versi
7f8e34
 	/* nbuttons tracks maximum buttons on all tools (stylus/mouse).
7f8e34
 	 *
7f8e34
 	 * Mouse support left, middle, right, side, and extra side button.
7f8e34
-	 * Stylus support tip and 2 stlyus buttons.
7f8e34
+	 * Stylus support tip and 3 stylus buttons.
7f8e34
 	 */
7f8e34
 	if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE))
7f8e34
 		usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS;
7f8e34
-- 
7f8e34
2.14.3
7f8e34