diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-10-28 01:12:28 +0200 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-10-28 01:12:28 +0200 |
commit | bf27c55a83a83fea4afe0499d1b2d592110e945a (patch) | |
tree | 6377cd5a861eb0be031f68b96dbf95fb957c655b /src | |
parent | 3089bc76c7e6a829caff4cb86ca3948401e1b6f3 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/acecad.c | 20 |
1 files changed, 19 insertions, 1 deletions
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 <xorgVersion.h> +#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; } |