Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2015-01-27 18:17:27 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2015-01-27 18:23:56 +0300
commit0d5ebabe437dcf5ce48685667d479d4706ba9d76 (patch)
treeafaf0d58f1bbe41c72a9ddacf6a7fc522d47c8be /intern
parent77848f23a49235b031b6d2d5b71654d12b7e66ad (diff)
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!
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_WindowX11.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_WindowX11.cpp b/intern/ghost/intern/GHOST_WindowX11.cpp
index ed8e9db85a9..9c3392b11bd 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);