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

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