mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-03-24 01:34:04 +00:00
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 <alan.coopersmith@oracle.com>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user