Mouse acceleration and X11

Hi guys,

I’ve been having some issues with mouse settings (acceleration or flat) intermittently defaulting after having set the speed and acceleration according to how I want them.
A logout / login solves the problem but whilst in my KDE the problems occurs again. I prefer slower cursor movement and it’s rather annoying to discover that the cursor suddenly speeds up. :expressionless:

I am running X11 Plasma according to the login screen.

I’ve tried a hack to xorg.conf :

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf Section "InputClass"
	Identifier "My Mouse"
	MatchIsPointer "yes"
# set the following to 1 1 0 respectively to disable acceleration.
	Option "AccelerationNumerator" "2"
	Option "AccelerationDenominator" "1"
	Option "AccelerationThreshold" "4"
EndSection

But no joy.

Don’t ask me why but I also tried the same thing to libinput for Wayland :

/etc/X11/xorg.conf.d/50-mouse-acceleration.conf Section "InputClass"
	Identifier "My Mouse"
	**Driver "libinput"**
	MatchIsPointer "yes"
	Option "AccelProfile" "flat"
	Option "AccelSpeed" "0"
EndSection

And voila, the mouse pointer seems to accept this configuration. So far no intermittent defaults.

But how come this works I am not running a Wayland session?

@newtoopensuse:

Did you try, in the KDE Plasma System SettingsHardwareInput DevicesMouse section – to setup the Pointer speed and Acceleration profile settings?
The Acceleration profile can be either “flat” or “adaptive”.

<https://docs.kde.org/stable5/en/plasma-desktop/kcontrol/mouse/index.html>
<https://docs.kde.org/stable5/en/systemsettings/systemsettings/index.html>

Sorry I should’ve been more clear, I used the GUI but it reverts to standard setting.

I checked the behaviour here and compared the changed settings to those in a saved copy of ‘~/.config/kcminputrc’


 .config> diff -cw ./kcminputrc ~/tmp/KDE/kcminputrc 
*** ./kcminputrc        2022-09-22 19:16:49.184288014 +0200
--- /home/xxx/tmp/KDE/kcminputrc  2022-08-23 13:06:20.165850065 +0200
***************
*** 16,23 ****
  MouseButtonMapping=RightHanded
  ReverseScrollPolarity=false
  Threshold=2
! **XLbInptAccelProfileFlat**=true
! **XLbInptPointerAcceleration**=-0.6
  cursorTheme=Oxygen_White
  
  [Tmp]
--- 16,23 ----
  MouseButtonMapping=RightHanded
  ReverseScrollPolarity=false
  Threshold=2
! **XLbInptAccelProfileFlat**=false
! **XLbInptPointerAcceleration**=0
  cursorTheme=Oxygen_White
  
  [Tmp]
 .config> 

What’s interesting is, the value of the parameter “AccelerationProfile” – that doesn’t change – it remains with the value “Adaptive” being set …
[HR][/HR]I really don’t know – when, in the KDE System Settings, I change the Acceleration Profile from “Adaptive” to “Flat” and, reduce the pointer speed somewhat, I get a Mouse Pointer behaviour which is for me, quite sluggish and slow.
The complete ‘kcminputrc’ section “Mouse” settings, for a slow, sluggish, Mouse Pointer on this machine, set by the System Settings Mouse settings, are:


[Mouse]
Acceleration=2
AccelerationProfile=Adaptive
MouseButtonMapping=RightHanded
ReverseScrollPolarity=false
Threshold=2
XLbInptAccelProfileFlat=false
XLbInptPointerAcceleration=-0.6
cursorTheme=Oxygen_White

Libinput serves both Wayland and Xorg environments. From the libinput wiki page
https://freedesktop.org/wiki/Software/libinput/

libinput

libinput is a library to handle input devices in Wayland compositors and to provide a generic X.Org input driver.

The Xorg configuration file is specific to Xorg behaviour of course.

I’m not saying it’s not… but, is “My Mouse” really the identifier of your mouse?

What does:

grep -e "Using input driver 'libinput'" /var/log/Xorg.0.log

show?

@dcurtisfra - Yes I’ve tried every setting in GUI and it reverts sporadically.

@deano_ferrari - Oh okay, so libinput shares its configs to xorg as well. That makes sense. Because ever since I chose libinput to handle my mouse, I’m having zero issues.

@tannington - I will check my xorg configuration files later, but I’m embarrassed to say I just did a copy and paste from archwiki just to see what happened. :-I

Actually, it’s the the Xorg config file(s) that provide a means to configure input devices using libinput (when using an Xorg environment).

That makes sense. Because ever since I chose libinput to handle my mouse, I’m having zero issues.

Good. :slight_smile:

Yeah. The other way around :). Can you imagine me setting up and using a Archlinux system (which I did couple of years back).
Being a GUI guy I am intrigued to manually configure config files as long as they’re aren’t too many. But it’s definitely interesting to see what happens behind the GUI curtains.

Hmmm –


 > rpm --query --whatprovides /etc/X11/xorg.conf.d/40-libinput.conf 
xf86-input-libinput-0.28.1-150400.13.10.x86_64
 > 
 > rpm --query --whatrequires xf86-input-libinput
patterns-base-x11-20200505-lp154.5.2.x86_64
plasma5-session-wayland-5.24.4-bp154.2.3.1.x86_64
 > rpm --query --whatrecommends xf86-input-libinput
no package recommends xf86-input-libinput
 > rpm --query --whatsuggests xf86-input-libinput
no package suggests xf86-input-libinput
 > 

Therefore, assuming that, you’ve not messed around with the default openSUSE RPM dependencies, you should have a “libinput” configuration file located in the system’s X11 configuration directory tree and, that default configuration will cause that, X11 and Wayland use “libinput” by default for the Mouse and, the Keyboard and, whatever else that’s available as input devices …

  • To be perfectly honest, what other distributions do regarding the configuration of input devices is often, counterproductive to the openSUSE/SUSE « do as much as possible automagically
    » approach to configuration …

The Xorg configuration files don’t apply to Wayland though.

Yes, but, it supplied the hint that, “libinput” is also required by KDE Plasma Wayland sessions …

Of course, Wayland requires libinput for input device handling. Any user configuration options are provided by the respective Wayland compositors.

libinput supports global file /etc/libinput/local-overrides.quirks. It is not strictly speaking configuration file, but sometimes it can be used when frontends do not offer necessary option. E.g. I use it to disable trackpoint (but leave its buttons enabled).

Of course downside is that these quirks are not really documented so you would likely need to check sources what they do.

As root I haven’t touched anything so it’s weird to me the libinput settings were empty, but yeah, it was a risk and pretty desparate move to use another distribution’s settings for this issue. On openSUSE forums I couldn’t find anything closely related than mouse settings reverting to default after reboot so it was sort of a last resort to copy and paste.
Since this little hack seems to work, it looks to me libinput wasn’t used by Xorg.

Here’s the output https://forums.opensuse.org/images/icons/icon6.png :

**linux-5wbg:~ #** grep -e "Using input driver 'libinput'" /var/log/Xorg.0.log 
    26.406] (II) **Using input driver 'libinput'** for 'Power Button' 
    26.454] (II) **Using input driver 'libinput'** for 'Power Button' 
    26.488] (II) **Using input driver 'libinput'** for 'Logitech Logitech Illuminated Keyboard' 
    26.521] (II) **Using input driver 'libinput'** for 'Logitech Logitech Illuminated Keyboard Consumer Control' 
    26.561] (II) **Using input driver 'libinput'** for 'USB OPTICAL MOUSE' 
    26.736] (II) **Using input driver 'libinput'** for 'USB OPTICAL MOUSE' 
    26.789] (II) **Using input driver 'libinput'** for 'Logitech Logitech Illuminated Keyboard Consumer Control'


So in my case Xorg refers to libinput for both keyboard and mouse.

For sure. Discussed here…
https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html
https://wayland.freedesktop.org/libinput/doc/latest/device-quirks.html#device-quirks-local

That configuration file would have been ignored as there is no device with the Identifier “My Mouse”…

X11 would use libinput’s default configuration matching your mouse with the “catchall” section of “/etc/X11/xorg.conf.d/40-libinput.conf”. Any changes you make to KDE’s settings (System Settings → Input Devices → Mouse) would over-ride the defaults.

If you want to experiment with your “/etc/X11/xorg.conf.d/50-mouse-acceleration.conf” you first need to change “My Mouse” to “USB OPTICAL MOUSE” as that’s how it’s identifying itself.

**linux-5wbg:~ #** grep -e "Using input driver 'libinput'" /var/log/Xorg.0.log 
... 
    26.561] (II) **Using input driver 'libinput'** for 'USB OPTICAL MOUSE' 
...

But… If all is working as you want then I would just delete the redundant “/etc/X11/xorg.conf.d/50-mouse-acceleration.conf” and leave as is.

Thanks for the input and explanation. I’ve removed the “/etc/X11/xorg.conf.d/50-mouse-acceleration.conf” and will see how it plays out.

Ok, my mouse started acting weird again after disabling

 /etc/X11/xorg.conf.d/50-mouse-acceleration.conf

, so I activated the file again (changed “My mouse” to “USB Optical mouse”). A bit weird that this file should override the other files.