Module: wine
Branch: master
Commit: 9267fcd99fb54d58b0928734a7ffe41fc479a4f3
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9267fcd99fb54d58b0928734a…
Author: Jeremy White <jwhite(a)winehq.org>
Date: Sun Dec 23 10:56:16 2007 -0600
wintab32: Correctly handle devices with a device id of 0.
The XInput macros such as DeviceMotionNotify will correctly return an eventclass of 0
if the device id is 0. Given that, we cannot use eventclass != 0 as a meaningful
test, and must instead use the returned type.
---
dlls/winex11.drv/wintab.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index 9b86345..11c8bfc 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -867,19 +867,19 @@ int X11DRV_AttachEventQueueToTablet(HWND hOwner)
if (the_device->num_classes > 0)
{
DeviceKeyPress(the_device, key_press_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (key_press_type) event_number++;
DeviceKeyRelease(the_device, key_release_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (key_release_type) event_number++;
DeviceButtonPress(the_device, button_press_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (button_press_type) event_number++;
DeviceButtonRelease(the_device, button_release_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (button_release_type) event_number++;
DeviceMotionNotify(the_device, motion_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (motion_type) event_number++;
ProximityIn(the_device, proximity_in_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (proximity_in_type) event_number++;
ProximityOut(the_device, proximity_out_type, event_list[event_number]);
- if (event_list[event_number]) event_number++;
+ if (proximity_out_type) event_number++;
if (key_press_type) X11DRV_register_event_handler( key_press_type, key_event );
if (key_release_type) X11DRV_register_event_handler( key_release_type, key_event );
Module: wine
Branch: master
Commit: d58429d085cdf890d9362a30b36626ca419e5b5a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=d58429d085cdf890d9362a30b…
Author: Jeremy White <jwhite(a)winehq.org>
Date: Sun Dec 23 10:56:03 2007 -0600
wintab32: Compute our physical device characteristics based on the first tablet device that looks like a stylus.
Otherwise, we may be computing based on a mouse or cursor, and then
come to incorrect values for our tilt and pressure settings.
---
dlls/winex11.drv/wintab.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c
index 7065cc8..9b86345 100644
--- a/dlls/winex11.drv/wintab.c
+++ b/dlls/winex11.drv/wintab.c
@@ -528,7 +528,13 @@ void X11DRV_LoadTabletInfo(HWND hwnddefault)
if (TRACE_ON(wintab32))
trace_axes(Val);
- if (!axis_read_complete)
+ /* FIXME: This is imperfect; we compute our devices capabilities based upon the
+ ** first pen type device we find. However, a more correct implementation
+ ** would require acquiring a wide variety of tablets and running through
+ ** the various inputs to see what the values are. Odds are that a
+ ** more 'correct' algorithm would condense to this one anyway.
+ */
+ if (!axis_read_complete && Val->num_axes >= 5 && cursor->TYPE == CSR_TYPE_PEN)
{
Axis = (XAxisInfoPtr) ((char *) Val + sizeof
(XValuatorInfo));