From d21c533fd5b5a4aa47618b47dc4aa79fecd8d961 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 12 May 2024 14:21:12 -0700 Subject: Raise minimum supported Xserver version from 1.12 to 1.15 Drops support for ABI_XINPUT_VERSION < 20, including removing support for driver-side coordinate scaling, since the X server handles it now. Xserver 1.15 was released in Dec. 2013. Signed-off-by: Alan Coopersmith --- configure.ac | 2 +- src/synaptics.c | 45 --------------------------------------------- src/synapticsstr.h | 16 ---------------- 3 files changed, 1 insertion(+), 62 deletions(-) diff --git a/configure.ac b/configure.ac index a905b72..1783887 100644 --- a/configure.ac +++ b/configure.ac @@ -53,7 +53,7 @@ m4_ifndef([XORG_DRIVER_CHECK_EXT], XORG_DRIVER_CHECK_EXT(RANDR, randrproto) # Obtain compiler/linker options for the Synaptics driver dependencies -PKG_CHECK_MODULES(XORG, [inputproto >= 2.1.99.3] [xorg-server >= 1.12] xproto inputproto $REQUIRED_MODULES) +PKG_CHECK_MODULES(XORG, [inputproto >= 2.1.99.3] [xorg-server >= 1.15] xproto inputproto $REQUIRED_MODULES) # X Server SDK location is required to install Synaptics header files # This location is also relayed in the xorg-synaptics.pc file diff --git a/src/synaptics.c b/src/synaptics.c index 70d8809..02960de 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -133,11 +133,6 @@ static int DeviceOff(DeviceIntPtr); static int DeviceClose(DeviceIntPtr); static Bool QueryHardware(InputInfoPtr); static void ReadDevDimensions(InputInfoPtr); -#ifndef NO_DRIVER_SCALING -static void ScaleCoordinates(SynapticsPrivate * priv, - struct SynapticsHwState *hw); -static void CalculateScalingCoeffs(SynapticsPrivate * priv); -#endif static void SanitizeDimensions(InputInfoPtr pInfo); const static struct { @@ -914,11 +909,6 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags) set_default_parameters(pInfo); -#ifndef NO_DRIVER_SCALING - CalculateScalingCoeffs(priv); -#endif - - priv->comm.buffer = XisbNew(pInfo->fd, INPUT_BUFFER_SIZE); if (!QueryHardware(pInfo)) { @@ -3095,9 +3085,6 @@ HandleState(InputInfoPtr pInfo, struct SynapticsHwState *hw, CARD32 now, * calculations that require unadjusted coordinates, for example edge * detection. */ -#ifndef NO_DRIVER_SCALING - ScaleCoordinates(priv, hw); -#endif } dx = dy = 0; @@ -3208,35 +3195,3 @@ QueryHardware(InputInfoPtr pInfo) return TRUE; } - -#ifndef NO_DRIVER_SCALING -static void -ScaleCoordinates(SynapticsPrivate * priv, struct SynapticsHwState *hw) -{ - int xCenter = (priv->synpara.left_edge + priv->synpara.right_edge) / 2; - int yCenter = (priv->synpara.top_edge + priv->synpara.bottom_edge) / 2; - - hw->x = (hw->x - xCenter) * priv->horiz_coeff + xCenter; - hw->y = (hw->y - yCenter) * priv->vert_coeff + yCenter; -} - -void -CalculateScalingCoeffs(SynapticsPrivate * priv) -{ - int vertRes = priv->synpara.resolution_vert; - int horizRes = priv->synpara.resolution_horiz; - - if ((horizRes > vertRes) && (horizRes > 0)) { - priv->horiz_coeff = vertRes / (double) horizRes; - priv->vert_coeff = 1; - } - else if ((horizRes < vertRes) && (vertRes > 0)) { - priv->horiz_coeff = 1; - priv->vert_coeff = horizRes / (double) vertRes; - } - else { - priv->horiz_coeff = 1; - priv->vert_coeff = 1; - } -} -#endif diff --git a/src/synapticsstr.h b/src/synapticsstr.h index a6513db..992d60f 100644 --- a/src/synapticsstr.h +++ b/src/synapticsstr.h @@ -24,18 +24,6 @@ #include "synproto.h" -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) < 18 -#define LogMessageVerbSigSafe xf86MsgVerb -#endif - -#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) > 19 -#define NO_DRIVER_SCALING 1 -#elif GET_ABI_MAJOR(ABI_XINPUT_VERSION) == 19 && GET_ABI_MINOR(ABI_XINPUT_VERSION) >= 2 -/* as of 19.2, the server takes device resolution into account when scaling - relative events from abs device, so we must not scale in synaptics. */ -#define NO_DRIVER_SCALING 1 -#endif - #if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 23 #define HAVE_THREADED_INPUT 1 #endif @@ -295,10 +283,6 @@ struct _SynapticsPrivateRec { int prev_z; /* previous z value, for palm detection */ int prevFingers; /* previous numFingers, for transition detection */ int avg_width; /* weighted average of previous fingerWidth values */ -#ifndef NO_DRIVER_SCALING - double horiz_coeff; /* normalization factor for x coordinates */ - double vert_coeff; /* normalization factor for y coordinates */ -#endif int minx, maxx, miny, maxy; /* min/max dimensions as detected */ int minp, maxp, minw, maxw; /* min/max pressure and finger width as detected */ -- cgit v1.2.3