Incorrect vertical mouse leaps on qemu-system-sparc
Host environment
-
Operating system:
Ubuntu 22.04
-
OS/kernel version:
6.5.0-44-generic 44~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue Jun 18 14:36:16 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
-
Architecture:
x86_64
-
QEMU flavor:
qemu-system-sparc
-
QEMU version:
QEMU emulator version 9.0.2
-
QEMU command line:
qemu/build/qemu-system-sparc -display gtk -M SS-5 -m 256 -drive file=sparc.qcow2,bus=0,unit=0,media=disk
Emulated/Virtualized environment
-
Operating system:
Solaris 2.5.6 (sparc)
-
OS/kernel version:
SunOS solaris26 5.6 Generic_105181-05 sun4m sparc SUNW,SPARCstation-5 Solaris
-
Architecture:
sparc
Description of problem
In openwin (i.e. X) if you turn the scrollwheel on the mouse 1 click the cursor jumps almost all of the way down the screen. Similarly, just pressing the scroll wheel (middle click) multiple times will sometimes produce similar behavior but the cursor doesn't jump as far.
Steps to reproduce
- Boot Solaris and log in
- capture the mouse by clicking on the screen
- position the mouse cursor near the top of the screen (just so you can see how far it jumps)
- click the scroll wheel up or down one click and observe the cursor jump downward
Additional information
The issue is independent of which graphic display is used -- sdl, gtk and vnc all do the same thing. Debugging so far suggests that the problem is related to the fact that sunmouse_event
in escc.c
is sending a flood of duplicate events in response to the mouse scroll action. My surmise is that this is causing one byte to be dropped from the 5 byte mouse protocol expected by the Solaris kernel and that it is interpreting a sync byte as a vertical motion byte.
sunmouse_event
should not send events with only dz
non-zero and no button changes. The Mouse Systems Corp spec for the the Sun mouse says that it never sends duplicate events (i.e. an event is produced only if there is non-zero dx
or dy
or there has been a button state change), and the mouse protocol has no support for dz
events.
I will propose a patch shortly to enforce this (and which has seemingly fixed the problem).