winex11.drv[1/6]: wintab: copy also the button #0 state

Mikolaj Zalewski mikolajz at google.com
Thu Aug 30 20:24:17 CDT 2007


>From this series the first two patches fixes wintab so that a tablet
works with Photoshop 6-CS1 on my laptop. However I'm not an XInput
expert so I'm not sure they are correct. The patches 3-6 should be
independent from them and implement Unicode support in wintab32.

This patch copies the state bit #0 to the wintab client. As least on
my setup this bit represent the pressure button - a button that is
activated when the stylus contacts with the tablet and which state is
also reported by Windows wintab32. Without the information that this
button is pressed Photoshop will ignore the tablet data. The
WM_MOUSEDOWN will be still received so Photoshop will draw but as if
there was a maximal pressure.
-------------- next part --------------
From aeb3a8ce5fc1e5eba73b007c0d505c075eb15524 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Thu, 30 Aug 2007 12:41:37 -0700
Subject: [PATCH] winex11.drv: wintab: copy also the button #0 state

---
 dlls/winex11.drv/wintab.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index eece156..8846342 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -571,11 +571,11 @@ static void set_button_state(XID deviceid)
             {
                 int loop2;
                 XButtonState *button_state =  (XButtonState*)class;
-                for (loop2 = 1; loop2 <= button_state->num_buttons; loop2++)
+                for (loop2 = 0; loop2 < button_state->num_buttons; loop2++)
                 {
                     if (button_state->buttons[loop2 / 8] & (1 << (loop2 % 8)))
                     {
-                        rc |= (1<<(loop2-1));
+                        rc |= (1<<loop2);
                     }
                 }
             }
-- 
1.4.4.2


More information about the wine-patches mailing list