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"

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"

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?


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”.


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 ****
! **XLbInptAccelProfileFlat**=true
! **XLbInptPointerAcceleration**=-0.6
--- 16,23 ----
! **XLbInptAccelProfileFlat**=false
! **XLbInptPointerAcceleration**=0

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:


Libinput serves both Wayland and Xorg environments. From the libinput wiki page


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


@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 
 > rpm --query --whatrequires xf86-input-libinput
 > 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 :

**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…

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


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