[Bf-blender-cvs] [0d5ebab] master: Fix T43367: Non-wacom tablets broken on Blender in linux?

Bastien Montagne noreply at git.blender.org
Tue Jan 27 16:30:13 CET 2015


Commit: 0d5ebabe437dcf5ce48685667d479d4706ba9d76
Author: Bastien Montagne
Date:   Tue Jan 27 16:17:27 2015 +0100
Branches: master
https://developer.blender.org/rB0d5ebabe437dcf5ce48685667d479d4706ba9d76

Fix T43367: Non-wacom tablets broken on Blender in linux?

Looks like with some versions of Xlib (at least the 1.6.2 currently used on Debian testing)
and/or evdev generic driver (2.9.0 currently on Debian testing), you have to also 'select'
DeviceButton1Motion with the extended tablet's motion event, otherwise you won't get any
tablet motion event once pen is pressed, leading to no pressure (each stroke keeping its
init pressure until the end). Crap!

===================================================================

M	intern/ghost/intern/GHOST_WindowX11.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index ed8e9db..9c3392b 100644
--- a/intern/ghost/intern/GHOST_WindowX11.cpp
+++ b/intern/ghost/intern/GHOST_WindowX11.cpp
@@ -573,9 +573,16 @@ void GHOST_WindowX11::initXInputDevices()
 			XEventClass xevents[10], ev;
 			int dcount = 0;
 
+			/* With modern XInput (xlib 1.6.2 at least and/or evdev 2.9.0) and some 'no-name' tablets
+			 * like 'UC-LOGIC Tablet WP5540U', we also need to 'select' Button1 for motion event,
+			 * otherwise we do not get any tablet motion event once pen is pressed... See T43367.
+			 */
+
 			if (xtablet.StylusDevice) {
 				DeviceMotionNotify(xtablet.StylusDevice, xtablet.MotionEvent, ev);
 				if (ev) xevents[dcount++] = ev;
+				DeviceButton1Motion(xtablet.StylusDevice, xtablet.MotionEvent, ev);
+				if (ev) xevents[dcount++] = ev;
 				ProximityIn(xtablet.StylusDevice, xtablet.ProxInEvent, ev);
 				if (ev) xevents[dcount++] = ev;
 				ProximityOut(xtablet.StylusDevice, xtablet.ProxOutEvent, ev);
@@ -584,6 +591,8 @@ void GHOST_WindowX11::initXInputDevices()
 			if (xtablet.EraserDevice) {
 				DeviceMotionNotify(xtablet.EraserDevice, xtablet.MotionEvent, ev);
 				if (ev) xevents[dcount++] = ev;
+				DeviceButton1Motion(xtablet.StylusDevice, xtablet.MotionEvent, ev);
+				if (ev) xevents[dcount++] = ev;
 				ProximityIn(xtablet.EraserDevice, xtablet.ProxInEvent, ev);
 				if (ev) xevents[dcount++] = ev;
 				ProximityOut(xtablet.EraserDevice, xtablet.ProxOutEvent, ev);




More information about the Bf-blender-cvs mailing list