diff --git a/SOURCES/0001-Add-support-for-kernel-s-new-BTN_STYLUS3-event.patch b/SOURCES/0001-Add-support-for-kernel-s-new-BTN_STYLUS3-event.patch new file mode 100644 index 0000000..6c267aa --- /dev/null +++ b/SOURCES/0001-Add-support-for-kernel-s-new-BTN_STYLUS3-event.patch @@ -0,0 +1,53 @@ +From 4a96a58f2693b291b91e21b7e34f5c5e04015f3f Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Tue, 3 Oct 2017 13:45:37 -0700 +Subject: [PATCH] Add support for kernel's new BTN_STYLUS3 event + +BTN_STYLUS3 was (will be) added to the Linux 4.15 kernel to support the +third button present on Wacom's "Pro Pen 3D" stylus. This commit adds +support for this new event, mapping it to mouse button 8 ("navigate +back"). Remapping this button to a different function is possible by +using commands like `xsetwacom set button 8 `. + +Signed-off-by: Jason Gerecke +Reviewed-by: Peter Hutterer +--- + src/wcmUSB.c | 4 ++++ + src/xf86WacomDefs.h | 6 ++++++ + 2 files changed, 10 insertions(+) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index 0b5ec57..2f96a8a 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -1454,6 +1454,10 @@ static void usbParseKeyEvent(WacomCommonPtr common, + ds->buttons = mod_buttons(ds->buttons, 2, event->value); + break; + ++ case BTN_STYLUS3: ++ ds->buttons = mod_buttons(ds->buttons, 3, event->value); ++ break; ++ + default: + change = 0; + } +diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h +index ec34211..a772597 100644 +--- a/src/xf86WacomDefs.h ++++ b/src/xf86WacomDefs.h +@@ -93,6 +93,12 @@ + #define ABS_MT_SLOT 0x2f + #endif + ++/* 4.15 */ ++ ++#ifndef BTN_STYLUS3 ++#define BTN_STYLUS3 0x149 ++#endif ++ + /****************************************************************************** + * Forward Declarations + *****************************************************************************/ +-- +2.14.3 + diff --git a/SOURCES/0002-Allocate-4-buttons-for-stylus-devices-Pro-Pen-3D.patch b/SOURCES/0002-Allocate-4-buttons-for-stylus-devices-Pro-Pen-3D.patch new file mode 100644 index 0000000..43fa6a2 --- /dev/null +++ b/SOURCES/0002-Allocate-4-buttons-for-stylus-devices-Pro-Pen-3D.patch @@ -0,0 +1,46 @@ +From 685850060f1cef064a90e02191d4732f275c7179 Mon Sep 17 00:00:00 2001 +From: Jason Gerecke +Date: Tue, 26 Dec 2017 14:21:17 -0800 +Subject: [PATCH] Allocate 4 buttons for stylus devices (Pro Pen 3D) + +The Pro Pen 3D includes a third stylus button, reported from the kernel +as BTN_STYLUS3. Support for this event was added earlier, but the number +of buttons allocated was not updated. This meant that although the X +driver would properly set the button flag bit to indicate that a button +should be sent, a userspace event wouldn't actually be sent. This commit +increases the number of buttons allocated, causing the third button to +emit X11 button number 8 when pressed. This button can also be configured +through xsetwacom now that the driver allocates the correct number. + +Fixes: 4a96a58f26 ("Add support for kernel's new BTN_STYLUS3 event") +Signed-off-by: Jason Gerecke +Reviewed-by: Ping Cheng +--- + src/wcmUSB.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/wcmUSB.c b/src/wcmUSB.c +index 9190fbe..1e4dc51 100644 +--- a/src/wcmUSB.c ++++ b/src/wcmUSB.c +@@ -167,7 +167,7 @@ static unsigned short padkey_codes [] = { + /* Fixed mapped stylus and mouse buttons */ + + #define WCM_USB_MAX_MOUSE_BUTTONS 5 +-#define WCM_USB_MAX_STYLUS_BUTTONS 3 ++#define WCM_USB_MAX_STYLUS_BUTTONS 4 + + static unsigned short mouse_codes [] = { + BTN_LEFT, BTN_MIDDLE, BTN_RIGHT, BTN_BACK, BTN_FORWARD, +@@ -480,7 +480,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, size_t id_len, float *versi + /* nbuttons tracks maximum buttons on all tools (stylus/mouse). + * + * Mouse support left, middle, right, side, and extra side button. +- * Stylus support tip and 2 stlyus buttons. ++ * Stylus support tip and 3 stylus buttons. + */ + if (ISBITSET (common->wcmKeys, BTN_TOOL_MOUSE)) + usbdata->nbuttons = WCM_USB_MAX_MOUSE_BUTTONS; +-- +2.14.3 + diff --git a/SPECS/xorg-x11-drv-wacom.spec b/SPECS/xorg-x11-drv-wacom.spec index d88d6c9..a126ed9 100644 --- a/SPECS/xorg-x11-drv-wacom.spec +++ b/SPECS/xorg-x11-drv-wacom.spec @@ -9,7 +9,7 @@ Summary: Xorg X11 wacom input driver Name: xorg-x11-drv-wacom Version: 0.34.2 -Release: 4%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} +Release: 5%{?gitdate:.%{gitdate}git%{gitversion}}%{?dist} URL: http://www.x.org License: GPLv2+ Group: User Interface/X Hardware Support @@ -32,6 +32,10 @@ Patch05: 0003-Add-support-for-2nd-generation-Intuos-Pro.patch Patch06: 0004-Correct-device-flags-for-multiple-devices.patch Patch07: 0001-conf-add-Dell-Canvas-27-touch.patch +# Bug 1557255 - Add support for the Wacom Pro Pen 3D +Patch08: 0001-Add-support-for-kernel-s-new-BTN_STYLUS3-event.patch +Patch09: 0002-Allocate-4-buttons-for-stylus-devices-Pro-Pen-3D.patch + ExcludeArch: s390 s390x BuildRequires: xorg-x11-server-devel >= 1.10.99.902 @@ -58,6 +62,8 @@ X.Org X11 wacom input driver for Wacom tablets. %patch05 -p1 %patch06 -p1 %patch07 -p1 +%patch08 -p1 +%patch09 -p1 %build autoreconf --force -v --install || exit 1 @@ -119,6 +125,9 @@ X.Org X11 wacom input driver development files. %{_bindir}/isdv4-serial-debugger %changelog +* Thu Apr 05 2018 Peter Hutterer 0.34.2-5 +- Add support for the Pro Pen 3D (#1557255) + * Wed Nov 08 2017 Peter Hutterer 0.34.2-4 - Add custom .conf snippet for the Dell Canvas 27 touchscreen (#1506538)