summaryrefslogtreecommitdiff
path: root/src/xdrv
diff options
context:
space:
mode:
authorpingc <pingc>2008-12-30 22:04:02 +0000
committerpingc <pingc>2008-12-30 22:04:02 +0000
commit878a8cff4967d05748f4a786dbe2e7bdf59307e6 (patch)
tree80b777d4d7b241af8a69751cff406d4136749f1f /src/xdrv
parent987fcf7c814bd60a981616d2ec3833f8d0c15ed9 (diff)
downloadxf86-input-wacom-878a8cff4967d05748f4a786dbe2e7bdf59307e6.tar.gz
Workaround for Xorg 1.6
Diffstat (limited to 'src/xdrv')
-rwxr-xr-xsrc/xdrv/wcmConfig.c11
-rwxr-xr-xsrc/xdrv/wcmUSB.c33
-rwxr-xr-xsrc/xdrv/xf86Wacom.c31
-rwxr-xr-xsrc/xdrv/xf86Wacom.h7
4 files changed, 56 insertions, 26 deletions
diff --git a/src/xdrv/wcmConfig.c b/src/xdrv/wcmConfig.c
index ad5d648..6a95c3d 100755
--- a/src/xdrv/wcmConfig.c
+++ b/src/xdrv/wcmConfig.c
@@ -573,6 +573,8 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
*/
if (IsPad(priv))
xf86WcmSetPadCoreMode(local);
+else
+xf86Msg(X_CONFIG, "%s (%s) is not a pad \n", local->name, dev->identifier);
/* Store original local Core flag so it can be changed later */
if (local->flags & (XI86_ALWAYS_CORE | XI86_CORE_POINTER))
@@ -590,8 +592,7 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
common->wcmDevCls = &gWacomISDV4Device;
xf86Msg(X_CONFIG, "%s: forcing TabletPC ISD V4 protocol\n",
dev->identifier);
- common->wcmTPCButton = 1; /* Tablet PC buttons on by default */
- common->wcmTPCButtonDefault = 1;
+ common->wcmTPCButtonDefault = 1; /* Tablet PC buttons on by default */
}
s = xf86FindOptionValue(local->options, "Rotate");
@@ -840,7 +841,7 @@ static LocalDevicePtr xf86WcmInit(InputDriverPtr drv, IDevPtr dev, int flags)
common->wcmTPCButton = xf86SetBoolOption(local->options,
"TPCButton", common->wcmTPCButtonDefault);
if ( common->wcmTPCButton )
- xf86Msg(X_CONFIG, "%s: Tablet PC buttons on \n", common->wcmDevice);
+ xf86Msg(X_CONFIG, "%s: Tablet PC buttons are on \n", common->wcmDevice);
/* Touch applies to the whole tablet */
common->wcmTouch = xf86SetBoolOption(local->options, "Touch", common->wcmTouchDefault);
@@ -993,7 +994,11 @@ static XF86ModuleVersionInfo xf86WcmVersionRec =
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
+#ifdef WCM_XORG_XSERVER_1_6
+ XORG_VERSION_CURRENT,
+#else
XF86_VERSION_CURRENT,
+#endif
1, 0, 0,
ABI_CLASS_XINPUT,
ABI_XINPUT_VERSION,
diff --git a/src/xdrv/wcmUSB.c b/src/xdrv/wcmUSB.c
index f09d7e5..c6e24a9 100755
--- a/src/xdrv/wcmUSB.c
+++ b/src/xdrv/wcmUSB.c
@@ -526,15 +526,21 @@ Bool usbWcmInit(LocalDevicePtr local, char* id, float *version)
if (common->tablet_id == 0x9A || common->tablet_id == 0x93)
{
- char *s = xf86FindOptionValue(local->options, "Touch");
- if ( !s || (strstr(s, "on")) ) /* touch option is on */
- {
- common->wcmTouch = 1;
- }
-
/* TouchDefault was off for all devices */
- /* defaults to enable when touch is supported */
+ /* except when touch is supported */
common->wcmTouchDefault = 1;
+ common->wcmTPCButtonDefault = 1; /* Tablet PC buttons on by default */
+
+ /* check if touch was turned off in xorg.conf */
+ common->wcmTouch = xf86SetBoolOption(local->options, "Touch", common->wcmTouchDefault);
+ if ( common->wcmTouch )
+ xf86Msg(X_CONFIG, "%s: Touch is enabled \n", common->wcmDevice);
+
+ /* Tablet PC button applied to the whole tablet. Not just one tool */
+ common->wcmTPCButton = xf86SetBoolOption(local->options,
+ "TPCButton", common->wcmTPCButtonDefault);
+ if ( common->wcmTPCButton )
+ xf86Msg(X_CONFIG, "%s: Tablet PC buttons are on \n", common->wcmDevice);
}
}
@@ -690,10 +696,10 @@ int usbWcmGetRanges(LocalDevicePtr local)
if (IsTouch(priv) && common->wcmMaxX && common->wcmMaxY)
{
- common->wcmTouchResolX = common->wcmMaxTouchX *
- common->wcmResolX / common->wcmMaxX;
- common->wcmTouchResolY = common->wcmMaxTouchY *
- common->wcmResolY / common->wcmMaxY;
+ common->wcmTouchResolX = (int)((double)(common->wcmMaxTouchX *
+ common->wcmResolX) / (double)common->wcmMaxX + 0.5);
+ common->wcmTouchResolY = (int)((double)(common->wcmMaxTouchY *
+ common->wcmResolY) / (double)common->wcmMaxY + 0.5);
if (!common->wcmTouchResolX || !common->wcmTouchResolY)
{
ErrorF("WACOM: touch max value(s) was wrong MaxTouchY"
@@ -794,7 +800,7 @@ static void usbParseEvent(LocalDevicePtr local,
if (common->wcmEventCnt >=
(sizeof(common->wcmEvents)/sizeof(*common->wcmEvents)))
{
- ErrorF("usbParse: Exceeded event queue (%d)\n",
+ ErrorF("usbParse: Exceeded event queue (%d) \n",
common->wcmEventCnt);
common->wcmEventCnt = 0;
common->wcmLastToolSerial = 0;
@@ -889,7 +895,8 @@ static void usbParseEvent(LocalDevicePtr local,
{
/* this should never happen in normal use */
ErrorF("usbParse: Exceeded channel count; "
- "ignoring.\n");
+ "ignoring the events.\n");
+ common->wcmEventCnt = 0;
return;
}
diff --git a/src/xdrv/xf86Wacom.c b/src/xdrv/xf86Wacom.c
index 7b61113..4bf51d9 100755
--- a/src/xdrv/xf86Wacom.c
+++ b/src/xdrv/xf86Wacom.c
@@ -74,9 +74,10 @@
* 2008-07-17 47-pc0.8.1-1 - Support USB TabletPC
* 2008-08-27 47-pc0.8.1-4 - Support Bamboo1 Meadium and Monarch
* 2008-11-11 47-pc0.8.2 - new release
+ * 2008-12-22 47-pc0.8.2-1 - fixed a few issues
*/
-static const char identification[] = "$Identification: 47-0.8.2 $";
+static const char identification[] = "$Identification: 47-0.8.2-1 $";
/****************************************************************************/
@@ -576,7 +577,7 @@ static int xf86WcmRegisterX11Devices (LocalDevicePtr local)
return FALSE;
}
- if (nbaxes || nbaxes > 6)
+ if (!nbaxes || nbaxes > 6)
nbaxes = priv->naxes = 6;
if (InitValuatorClassDeviceStruct(local->dev, nbaxes,
@@ -584,7 +585,9 @@ static int xf86WcmRegisterX11Devices (LocalDevicePtr local)
xf86GetMotionEvents,
local->history_size,
#else
+#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 3
GetMotionHistory,
+#endif
GetMotionHistorySize(),
#endif
((priv->flags & ABSOLUTE_FLAG) ?
@@ -899,9 +902,9 @@ void xf86WcmReadPacket(LocalDevicePtr local)
pos = 0;
/* while there are whole packets present, check the packet length
- * for ISDv4 packet since it's different for pen and touch
+ * for serial ISDv4 packet since it's different for pen and touch
*/
- if (common->wcmForceDevice == DEVICE_ISDV4)
+ if (common->wcmForceDevice == DEVICE_ISDV4 && common->wcmDevCls != &gWacomUSBDevice)
{
common->wcmPktLength = 9;
data = common->buffer;
@@ -927,14 +930,24 @@ void xf86WcmReadPacket(LocalDevicePtr local)
if (common->wcmDevCls != &gWacomUSBDevice)
{
- common->wcmPktLength = 9;
data = common->buffer + pos;
if ( data[0] & 0x18 )
{
- if (common->wcmMaxCapacity)
- common->wcmPktLength = 7;
- else
- common->wcmPktLength = 5;
+ if (common->wcmPktLength == 9)
+ {
+ DBG(1, common->debugLevel,
+ ErrorF("xf86WcmReadPacket: not a pen data any more \n"));
+ break;
+ }
+ }
+ else
+ {
+ if (common->wcmPktLength != 9)
+ {
+ DBG(1, common->debugLevel,
+ ErrorF("xf86WcmReadPacket: not a touch data any more \n"));
+ break;
+ }
}
}
}
diff --git a/src/xdrv/xf86Wacom.h b/src/xdrv/xf86Wacom.h
index eb67188..3b299bf 100755
--- a/src/xdrv/xf86Wacom.h
+++ b/src/xdrv/xf86Wacom.h
@@ -23,7 +23,12 @@
/****************************************************************************/
#include "../include/xdrv-config.h"
-#include <xf86Version.h>
+#ifdef WCM_XORG_XSERVER_1_6
+ #include <xorg-server.h>
+ #include <xorgVersion.h>
+#else
+ #include <xf86Version.h>
+#endif
#include "../include/Xwacom.h"
/*****************************************************************************