SUMMARY Comming from here: https://gitlab.freedesktop.org/libinput/libinput/-/issues/558#note_2773967 Unlike Gnome (Wayland), Plasma (Wayland) seems to not close the respective file descriptor of the /sys/class/input/event* node when the touchpad is disabled. This is relevant for the kernel to know when the touchpad is actually in use and when it can be deactivated, safeing some battery life and triggering touchpad enabled/disabled leds. STEPS TO REPRODUCE 1. Deactivate touchpad e.g. by using a shortcut OBSERVED RESULT The kernel does not see a change in the file descriptor open count. EXPECTED RESULT The file descriptor is closed and kernel can react to it. SOFTWARE/OS VERSIONS Linux/KDE Plasma: 6.2.5 KDE Plasma Version: 6.2.5 (Wayland) KDE Frameworks Version: 6.10.0 Qt Version: 6.8.1 ADDITIONAL INFORMATION All my knowledge about libinput comes from the libinput issue I linked above, so please excuse some errors and vagueness and this is my guess based in this xD: Gnome and Plasma seem to use libinput, which handles the file descriptors, differently. Especially: While switching from Plasma to a TTY libinput_suspend() and libinput_resume() seem to be called accordingly, they seem not to be called when enabling or disabling the touchpad in Plasma. From the perspective on libinput the touchpad seems to always be active.
I left a message in the upstream issue, not sure that the compositor has to close file descriptors manually. If it needs to do so though, we would need some major changes around input device tracking, which won't be great...
Can you please run qdbus org.kde.KWin /org/kde/KWin/InputDevice/event0 org.freedesktop.DBus.Properties.GetAll org.kde.KWin.InputDevice where event0 is the name of the touchpad input device
Created attachment 178154 [details] qdbus touchpad enabled
Created attachment 178155 [details] qdbus touchpad disabled
(In reply to Vlad Zahorodnii from comment #2) > Can you please run > > qdbus org.kde.KWin /org/kde/KWin/InputDevice/event0 > org.freedesktop.DBus.Properties.GetAll org.kde.KWin.InputDevice > > where event0 is the name of the touchpad input device ofc see attachments above
Okay, supportsDisableEvents: true supportsDisableEventsOnExternalMouse: true are fine. I'm not sure what we can do on the kwin side. kwin will call libinput_device_config_send_events_set_mode() with LIBINPUT_CONFIG_SEND_EVENTS_DISABLED if a touchpad is disabled. And as I said previously, I don't think we will be able to support closing input device fds manually, it will make input device management very difficult, and maybe it's a libinput bug. If the input device file descriptor needs to be closed, libinput could do it in libinput_device_config_send_events_set_mode() while still keeping the libinput_device object alive.
(In reply to Vlad Zahorodnii from comment #6) > Okay, > > supportsDisableEvents: true > supportsDisableEventsOnExternalMouse: true > > are fine. I'm not sure what we can do on the kwin side. kwin will call > libinput_device_config_send_events_set_mode() with > LIBINPUT_CONFIG_SEND_EVENTS_DISABLED if a touchpad is disabled. And as I > said previously, I don't think we will be able to support closing input > device fds manually, it will make input device management very difficult, > and maybe it's a libinput bug. If the input device file descriptor needs to > be closed, libinput could do it in > libinput_device_config_send_events_set_mode() while still keeping the > libinput_device object alive. New infos: I added some printf debugging to the kernel, when on desktop there are actually 2 file descriptors open for the touchpad, only one gets closed when deactivating it. Some something else, maybe unrelated to kwin, is also listening to it?
(In reply to Werner Sembach [TUXEDO] from comment #7) > (In reply to Vlad Zahorodnii from comment #6) > > Okay, > > > > supportsDisableEvents: true > > supportsDisableEventsOnExternalMouse: true > > > > are fine. I'm not sure what we can do on the kwin side. kwin will call > > libinput_device_config_send_events_set_mode() with > > LIBINPUT_CONFIG_SEND_EVENTS_DISABLED if a touchpad is disabled. And as I > > said previously, I don't think we will be able to support closing input > > device fds manually, it will make input device management very difficult, > > and maybe it's a libinput bug. If the input device file descriptor needs to > > be closed, libinput could do it in > > libinput_device_config_send_events_set_mode() while still keeping the > > libinput_device object alive. > > New infos: I added some printf debugging to the kernel, when on desktop > there are actually 2 file descriptors open for the touchpad, only one gets > closed when deactivating it. > > Some something else, maybe unrelated to kwin, is also listening to it? Maybe it's logind? kwin uses it to open device files that require special privileges.
https://invent.kde.org/plasma/kwin/-/blob/5af9449ebdacffcdc0175084ecdeed5a495739b6/src/core/session_logind.cpp#L168