Inconsistent and erratic mouse wheel in Linux while moving the mouse pointer
I have Manjaro Linux in VirtualBox, and in some applications such as the terminal the mouse wheel seems not to register many of the scroll ticks. Sometimes it scrolls fine, then suddenly it scrolls only half as much or stops scrolling at all. In other applications such as Firefox, the scroll wheel always works.
After some experimentation I found that I can't scroll at all while I'm moving the mouse pointer. Yet, when I hold the pointer perfectly still, scrolling works as expected.
There are some related questions on this site, but none have this specific issue caused by moving the mouse pointer while scrolling in Linux.
I found this post on the VirtualBox forums in a thread that exactly describes my problem. It seems to be unrelated to VirtualBox, as VMWare shows the same behavior.
The solution that worked for me:
-
Check that you're currently using
libinput
.$ grep "Using input" /var/log/Xorg.0.log [ 0.000] (II) Using input driver 'libinput' for 'Power Button' [ 0.001] (II) Using input driver 'libinput' for 'Sleep Button' [ 0.002] (II) Using input driver 'libinput' for 'Video Bus' [ 0.003] (II) Using input driver 'libinput' for 'VirtualBox mouse integration' [ 0.004] (II) Using input driver 'libinput' for 'VirtualBox USB Tablet' [ 0.005] (II) Using input driver 'libinput' for 'AT Translated Set 2 keyboard' [ 0.006] (II) Using input driver 'libinput' for 'ImExPS/2 Generic Explorer Mouse' [ 0.007] (II) Using input driver 'libinput' for 'VirtualBox USB Tablet'
Install the
evdev
input drivers.
On Manjaro this is found in thexf86-input-evdev
package, which was already installed.-
Enable the
evdev
drivers by modifying the X11 configuration.
In the directory/usr/share/X11/xorg.conf.d/
I already had a file10-evdev.conf
with theevdev
configuration. It was just overridden by the higher-priority40-libinput.conf
configuration. So all I had to do was:cd /usr/share/X11/xorg.conf.d/ sudo mv 10-evdev.conf 80-evdev.conf
Restart.
-
Verify that the
evdev
drivers are now used instead:$ grep "Using input" /var/log/Xorg.0.log [ 0.000] (II) Using input driver 'evdev' for 'Power Button' [ 0.001] (II) Using input driver 'evdev' for 'Sleep Button' [ 0.002] (II) Using input driver 'evdev' for 'Video Bus' [ 0.003] (II) Using input driver 'evdev' for 'VirtualBox mouse integration' [ 0.004] (II) Using input driver 'evdev' for 'VirtualBox USB Tablet' [ 0.005] (II) Using input driver 'evdev' for 'AT Translated Set 2 keyboard' [ 0.006] (II) Using input driver 'evdev' for 'ImExPS/2 Generic Explorer Mouse' [ 0.007] (II) Using input driver 'evdev' for 'VirtualBox USB Tablet'
This however didn't yet fix my problem. Apparently I needed
imwheel
too. - Install
imwheel
. On Arch, I had to install the imwheel AUR package. -
Run
imwheel
to verify that this fixes the issue.$ imwheel
-
All that remained was to make
imwheel
run at startup. I run this command, as it only intercepts the scroll wheel:imwheel -b 45
This fixed the issues! Scrolling is now working correctly in all applications.
Had the same issue running "Mint 19.3 XFCE" on "VBox 6.0.18" (Host: Windows 10 Professional).
All I did to fix it was go to Settings / "Mouse and Touchpad" and in Devices turn off "VirtualBox mouse integration".
I have not yet noticed any side effects of my now less integrated mouse, except that it scrolls perfectly.