KDE: touchpad natural scrolling preference changing

I use the natural (reverse) scrolling option for the touchpad.

From time to time, it goes back to default.

I don't know why. Maybe because I have a bluetooth mouse connected and it is NOT using natural scrolling, and it messes it up?

It seems to be KDE related as it works fine (with mouse connected too) on XFCE and Gnome

edit: I do believe it has something to do with the bluetooth mouse.

  • computer comes back up from sleep

  • touchpad works in natural mode

  • bluetooth blinks frantically and connects to mouse (often fails and I have to redetect bluetooth adapter)

  • as soon as mouse is reconnected, scrolling goes back to default

If I go to mouse settings and enable natural scrolling BEFORE going back to the trackpad settings, trackpad will go back to natural scrolling mode

The 2 devices are not always synced either, I can have one using each mode, but on wake from sleep the mouse seems to override the touchpad somehow.

Sorry for the blabbering, don't know what is relevant

CONFIGURATION

System:    Host: remi-xps-manjaro-kde Kernel: 4.17.9-1-MANJARO x86_64 bits: 64 compiler: gcc v: 8.1.1 
           Desktop: KDE Plasma 5.13.3 Distro: Manjaro Linux 
Machine:   Type: Laptop System: Dell product: XPS 13 9360 v: N/A serial: <filter> 
           Mobo: Dell model: 0PF86Y v: A00 serial: <filter> UEFI: Dell v: 2.8.1 date: 06/14/2018 
Battery:   ID-1: BAT0 charge: 60.0 Wh condition: 60.0/60.0 Wh (100%) model: SMP DELL TP1GT61 status: Full 
CPU:       Topology: Dual Core model: Intel Core i7-7560U bits: 64 type: MT MCP arch: Kaby Lake rev: 9 
           L2 cache: 4096 KiB 
           flags: lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 19204 
           Speed: 801 MHz min/max: 400/3800 MHz Core speeds (MHz): 1: 884 2: 854 3: 879 4: 884 
Graphics:  Card-1: Intel driver: i915 v: kernel bus ID: 00:02.0 
           Display: x11 server: X.Org 1.19.6 driver: intel unloaded: modesetting tty: N/A 
           OpenGL: renderer: Mesa DRI Intel Iris Plus Graphics 640 (Kaby Lake GT3e) v: 4.5 Mesa 18.1.4 
           direct render: Yes 
Audio:     Card-1: Intel Sunrise Point-LP HD Audio driver: snd_hda_intel v: kernel bus ID: 00:1f.3 
           Sound Server: ALSA v: k4.17.9-1-MANJARO 
Network:   Card-1: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter driver: ath10k_pci v: kernel 
           bus ID: 3a:00 
           IF: wlp58s0 state: up mac: <filter> 
           Card-2: Qualcomm Atheros type: USB driver: btusb bus ID: 1:2 
Drives:    Local Storage: total: 476.94 GiB used: 9.62 GiB (2.0%) 
           ID-1: /dev/nvme0n1 vendor: Toshiba model: THNSN5512GPUK NVMe 512GB size: 476.94 GiB 
Partition: ID-1: / size: 225.24 GiB used: 9.60 GiB (4.3%) fs: ext4 dev: /dev/nvme0n1p4 
           ID-2: swap-1 size: 16.94 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p3 
Sensors:   System Temperatures: cpu: 52.0 C mobo: N/A 
           Fan Speeds (RPM): N/A 
Info:      Processes: 180 Uptime: 56m Memory: 15.40 GiB used: 2.73 GiB (17.7%) Init: systemd Compilers: 
           gcc: 8.1.1 Shell: bash v: 4.4.23 inxi: 3.0.18 

Can you test it on clean, test user? It will give us some answer whether it's a config thing or not. I never experienced such behavior on my Plasma installs. It may be a bug caused by suspending and the following certain actions as you described.

This is a confirmed bug and already reported here also.

I am not using KDE but if the workaround @philm pointed out here works for you, you can create an executable script in

/usr/lib/systemd/system-sleep/

Name it how ever you are pleased to. Should contain the following:

case $1 in
    post) kcminit kcm_touchpad
   ;;
esac

I cannot test it here (no kde). Let us know if that does the job.

Hi all. Sorry, I didn't see that bug before posting.

I did try with a test session, same issue.

Thanks for the fix, I'll try that

edit: it's not working, but it was worth a try. I've added my votes to the bugs.kde thread

thanks all for helping!

edit 2: oh wait, after entering kcminit kcm_touchpadin terminal it seems to work. I suppose that's what the file is meant to do?

Hey calvous, I'd really like to make the script work if possible :slight_smile:

It might be an error on my part. Should the file have any kind of extension, like .sh ? Do I have to manually make it executable?

Thanks

AFAIK you need to make it executable.

chmod 755 /usr/lib/systemd/system-sleep/<your script name>

Another thing is, I do not really know if your KDE is going thru this routine at all. So pls add something to the script that clearly marks it in the journal like:

echo "[user_script] Initializing touchpad..."

then, after your computer wakes up do a

$ journalctl | grep "user_script"

and see wether it shows up or not. If not, there might be other ways to get it started after a resume.

Edit: The first line of your script should contain this

#!/bin/sh

or

#!/bin/bash

I have tried manjaro for a couple weeks, my first time, and tho it's great i'm going back to fedora. But i wanted to pay back a little with bug reports. My main one is this:


And the only other issue i was going to mention was trackpad problems, yes, in kde.

The reason i'm adding to this thread is that
1] I've had no problems in fedora/-related kde.
2] I never use suspend. I do have a bluetooth mouse but i don't always use it and i think i've had problems when only trackpad was enabled.
3] I've a variety of maybe-related problems:
a] reverse scrolling not only not remembered as enabled, but odd message at the settings dialog, " Active settings don't match saved settings. You currently see saved settings.", option to show active settings, which are natural scrolling off and yet 'apply' button active as if i changed something. I have to hit apply, then put natural scrolling on and hit apply again to get that functionality.
b] 2-finger vertical scrolling (in nemo, at least) is fast-twitchy with the '4 compass directions' cursor, works but iffy
c] (bluetooth) mouse scrolling sometimes freezes, i think only in nemo, can be restored by vertical scrolling in another program eg firefox and then coming back to nemo.

Never had these problems in years of kde, nor recently in mint (cinnamon).

Ok, i just turned on my bluetooth mouse and lost the reverse scrolling of touchpad, had to restore thru odd process just described.

Hope this adds/helps. Thx so much and great job on manjaro!

Again, I dunno much about KDE but if you use Xorg as your basic window system check for some files in "/etc/X11/xorg.conf.d"

$ cat /etc/X11/xorg.conf.d/30-touchpad.conf
Section "InputClass"
    Identifier "touchpad"
    Driver "libinput"
    MatchIsTouchpad "on"
    Option "Tapping" "on"
EndSection

This is parsed during start of Xorg and remains in its cache. KDE probably does not use this but maybe it helps with your problem if you tweak around in this file a little. So if KDE does not do anything after resume it could fall back to Xorg defaults.

You probably do not have this file with your KDE edition. Just create it. Won't do any harm.

First of al thanks a lot for helping.

I've done like you've said.

After wake bug still there, but the control line shows up

[remi@remi-xps-manjaro-kde ~]$ journalctl | grep "user_script"
août 08 21:02:46 remi-xps-manjaro-kde systemd-sleep[11982]: [user_script] Initializing touchpad...
août 08 21:02:56 remi-xps-manjaro-kde systemd-sleep[11982]: [user_script] Initializing touchpad...


It looks like the script does do the job, but KDE is overwriting it. So if you type this command on a terminal, everything works right. Let us tweak it a little:

$ which kcminit

This should give you the full path of this programm. If so, add it to the script (the path) if not, we have a typo or have to find it in some directory of your kde installation.

I tried it, with no success.

I'm back on XFCE for the time being. I have a lot of other issues to fix in KDE, I'll come back to it when I have time.

Thanks for the help Calvous, really appreciated :slight_smile:

Forum kindly sponsored by