[Wayland-bugs] [Bug 96982] xf86-input-libinput: Rough and lopsided mouse movement in games/apps that reposition mouse
bugzilla-daemon at freedesktop.org
bugzilla-daemon at freedesktop.org
Fri Aug 5 00:29:16 UTC 2016
https://bugs.freedesktop.org/show_bug.cgi?id=96982
Peter Hutterer <peter.hutterer at who-t.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |NOTOURBUG
Status|ASSIGNED |RESOLVED
--- Comment #7 from Peter Hutterer <peter.hutterer at who-t.net> ---
This is a bug in Unity3D, the libinput driver passes on the events correctly
but because we do pointer acceleration inside libinput, slow motion is mostly
subpixel motion. We also have a different accel methods, so subpixel motion is
more common. In evdev, the driver itself does not usually handle subpixel
motion, coordinates submitted to the server are always in whole integers (see
below though).
The odd thing about unity3d here is that it continuously sends WarpPointer
requests (and to which the server replies with a core Motion event). unity3d
does this that even while the mouse isn't moving. Note that core motion events
do not contain subpixel information and the server buffers that internally
until a full pixel motion has been reached. Also note that internally the
server only deals with absolute coordinates once the immediate event has been
dealt with (i.e. scaled into screen coordinates and/or accelerated). The server
picks the correct device to warp, so normally you'd have a sequence like this:
* pointer is at 100.0/100.0
* mouse moves by 0.2/0.0 pixels
* mouse moves by 0.5/0.0 pixels
* mouse moves by 0.4/0.0 pixels
* server sends motion event for 101/100, position internally is 101.1/100
unity3d keeps sending WarpPointer requests and by definition they move the
mouse onto the given position. Since WarpPointer is a core request it doesn't
do subpixel. So now you get this sequence:
* pointer is at 100.0/100.0
* mouse moves by 0.2/0.0 pixels
* mouse moves by 0.5/0.0 pixels
* WarpPointer resets to 100/100
* mouse moves by 0.4/0.0 pixels
* WarpPointer resets to 100/100
* mouse moves by 0.8/0.0 pixels
* WarpPointer resets to 100/100
* mouse moves by 0.8/0.0 pixels
* mouse moves by 0.6/0.0 pixels
* server sends motion event for 101/100, position internally is 101.4/100
* WarpPointer resets to 100/100
As you can see, some events are swallowed because the continuous WarpPointer
requests simply undo any internal buffering the server does. This can be
reproduced with the synaptics driver which also does acceleration and submits
subpixel motion and the evdev driver when the Option Resolution is set to
something higher than the mouse resolution (and thus most motion events are
subpixel motion).
So I'm going to have to punt this to Unity3D, it's broken with all drivers that
send subpixel motion.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/wayland-bugs/attachments/20160805/58e97455/attachment.html>
More information about the wayland-bugs
mailing list