mirror of
https://github.com/X11Libre/xf86-input-synaptics.git
synced 2026-03-24 01:34:04 +00:00
Disable driver scaling for input ABI 19.2
For absolute devices in relative mode, i.e. touchpads, the server now takes device resolution into account. Doing so means that the driver mustn't scale, so we deactivate those bits in the driver. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -133,9 +133,11 @@ 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);
|
||||
|
||||
void InitDeviceProperties(InputInfoPtr pInfo);
|
||||
@@ -829,7 +831,10 @@ 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);
|
||||
|
||||
@@ -2863,7 +2868,9 @@ 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;
|
||||
@@ -2987,6 +2994,7 @@ QueryHardware(InputInfoPtr pInfo)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#ifndef NO_DRIVER_SCALING
|
||||
static void
|
||||
ScaleCoordinates(SynapticsPrivate * priv, struct SynapticsHwState *hw)
|
||||
{
|
||||
@@ -3016,3 +3024,4 @@ CalculateScalingCoeffs(SynapticsPrivate * priv)
|
||||
priv->vert_coeff = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -28,6 +28,14 @@
|
||||
#define LogMessageVerbSigSafe xf86MsgVerb
|
||||
#endif
|
||||
|
||||
#if GET_ABI_MAJOR(ABI_XINPUT_VERSION) >= 19
|
||||
#if 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
|
||||
#endif
|
||||
|
||||
#ifdef DBG
|
||||
#undef DBG
|
||||
#endif
|
||||
@@ -250,8 +258,10 @@ 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 coordintes */
|
||||
double vert_coeff; /* normalization factor for y coordintes */
|
||||
#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