It is still unclear why typing should cause motion events, but the cause of
the cursor jumps seems to be a bug in the X acceleration code, triggered by
an unusual setup of the acceleration profile. It can easily be reproduced
with a command like
$ xset mouse 2/3 0
in an X terminal. Whenever a movement with a mouse, trackpoint, or a
touchpad running with the ws driver starts, the cursor jumps to the top-left
corner - or an edge - of the screen. The cursor is moving normally after that
jump.
That phemomenon does not occur when the acceleration factor is greater than
or equal to 1.0, or the threshold value is greater than 0. (BTW,
$ xset mouse
restores the default setup.)
Touchpads handled by the synaptics driver - which uses a device-specific
acceleration function - are not affected.
A setup with an acceleration factor < 1.0 doesn't make sense for ws-
devices. The default functions of X seem to set a lower limit of 1.0, such
that you won't observe a difference between, e.g.,
$ xset mouse 1 1
and
$ xset mouse 1/16 1
Again, things are different with the synaptics driver, which can slow down
the cursor movements (with a lower limit of 0.4 (?)).
What follows are hints to the technical aspects:
With a setup like the one above, logs from
$ xinput test-xi2
regularly show event sequences like
EVENT type 17 (RawMotion)
device: 2 (7)
time: 851406
detail: 0
flags:
valuators:
0: 1.00 (1.00)
1: 0.00 (0.00)
EVENT type 17 (RawMotion)
device: 2 (7)
time: 851413
detail: 0
flags:
valuators:
0: -2147483648.00 (1.00)
1: -2147483648.00 (1.00)
EVENT type 17 (RawMotion)
device: 2 (7)
time: 851420
detail: 0
flags:
valuators:
0: 2.00 (2.00)
1: 1.00 (1.00)
The "valuator" lines have the format
<index>: <transformed coordinate value> (<raw coordinate value>)
The transformed coordinates of the second event look like the infinity
value after a cast to int32.
When the acceleration threshold is 0, the following function enters into
the computation of a scaling factor for the transformation
(xenocara/xserver/dix/ptrveloc.c, v 1.11, L824ff.):
static double
PolynomialAccelerationProfile(DeviceIntPtr dev,
DeviceVelocityPtr vel,
double velocity, double ignored, double acc)
{
return pow(velocity, (acc - 1.0) * 0.5);
}
If the 'velocity' argument is 0 and the acceleration multiplier 'acc' is
less than 1.0, it will return the (positive) infinity value. Perhaps the
author thought this cannot happen, maybe it didn't occur in earlier versions
of the code, but it does happen when the calling function accesses the
'last_velocity' field of the DeviceVelocity record for the first time
within a movement sequence (L794, in 'ComputeAcceleration').
On 8/1/26 01:16, Jonathan Thornburg wrote:
> I have a Lenovo T16 Gen 3 laptop running 7.9-stable/amd64 (dmesg below).
> It has a problem with the touchpad/trackpoint: at "random" intervals
> while I'm typing, the X-windows cursor will jump to either the top left
> corner of the screen, or the top of the screen.
>
> More information:
> * This was a clean install of 7.9 on a new-to-me laptop. 'syspatch -l'
> currently shows patches 001 through 007. I'm using GENERIC.MP.
> * The "random" intervals between cursor-jumps range from every few seconds
> (e.g., there were several cursor-jumps as I was typing the opening
> sentence of this message) to every few minutes. I can't see any pattern
> to when the jumps are more vs. less frequent.
> * Any given X-windows-cursor jump is either to the top left corner of the
> screen (~90% of the time), or to the top of the screen (~10% of the time);
> in this latter case the cursor jumps vertically upwards, preserving the
> x coordinate.
> * The cursor only jumps when I'm typing; I have never seen it jump when
> I'm not typing. Notably, I have never seen the cursor-jump behavior
> while using the touchpad to move the cursor.
> * The X input focus responds "normally" to the cursor jumps, i.e., if
> the current window doesn't include the jump destination then the current
> window loses input focus and the window (if any) at the jump destination
> gains input focus (I only use focus-follows-mouse window managers).
> * I normally don't use the trackpoint ("nipple"). If I try moving it,
> the X-windows cursor almost always jumps at the beginning of the move.
> * It doesn't seem to matter what program has the X-windows input focus
> when I'm typing (most common are vi or the firefox address bar).
[...]