From bf27c55a83a83fea4afe0499d1b2d592110e945a Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Sun, 28 Oct 2007 01:12:28 +0200 Subject: acecad: fake device limits == screen limits in xserver 1.4 for xinput xserver 1.4 does not do automatic coordinate scaling, so we have to do it manually. But this breaks xinput clients that do their own scaling using the device limits as reference. Pretend that they are the same as the screen limits to work around this. --- src/acecad.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/acecad.c b/src/acecad.c index f67ffe3..a522205 100644 --- a/src/acecad.c +++ b/src/acecad.c @@ -27,6 +27,9 @@ #include "config.h" +#include +#define XORG_VERSION_BOTCHED XORG_VERSION_NUMERIC(1,4,0,0,0) + #define _ACECAD_C_ /***************************************************************************** * Standard Headers @@ -664,14 +667,22 @@ DeviceInit (DeviceIntPtr dev) InitValuatorAxisStruct(dev, 0, 0, /* min val */ +#if XORG_VERSION_CURRENT == XORG_VERSION_BOTCHED + screenInfo.screens[0]->width, +#else priv->acecadMaxX, /* max val */ +#endif 1000, /* resolution */ 0, /* min_res */ 1000); /* max_res */ InitValuatorAxisStruct(dev, 1, 0, /* min val */ +#if XORG_VERSION_CURRENT == XORG_VERSION_BOTCHED + screenInfo.screens[0]->height, +#else priv->acecadMaxY, /* max val */ +#endif 1000, /* resolution */ 0, /* min_res */ 1000); /* max_res */ @@ -927,7 +938,12 @@ USBReadInput (LocalDevicePtr local) if (prox) { +#if XORG_VERSION_CURRENT == XORG_VERSION_BOTCHED ConvertProc(local, 0, 3, x, y, 0, 0, 0, 0, &report_x, &report_y); +#else + report_x = x; + report_y = y; +#endif if (!(priv->acecadOldProximity)) if (!is_core_pointer) { @@ -954,7 +970,7 @@ USBReadInput (LocalDevicePtr local) if (!is_core_pointer) if (priv->acecadOldProximity) { - xf86PostProximityEvent(local->dev, 0, 0, 3, x,y,z); + xf86PostProximityEvent(local->dev, 0, 0, 3, report_x, report_y, z); } priv->acecadOldProximity = 0; } @@ -1003,8 +1019,10 @@ ReverseConvertProc (LocalDevicePtr local, { AceCadPrivatePtr priv = (AceCadPrivatePtr)(local->private); + // xf86Msg(X_INFO, "%s: reverse coordinate conversion in : %d, %d\n", local->name, x, y); valuators[0] = x * priv->acecadMaxX / screenInfo.screens[0]->width; valuators[1] = y * priv->acecadMaxY / screenInfo.screens[0]->height; + // xf86Msg(X_INFO, "%s: reverse coordinate conversion out: %d, %d\n", local->name, valuators[0], valuators[1]); return TRUE; } -- cgit v1.2.3