SUMMARY Hello, I'm a quadriplegic KDE user and can't migrate to Wayland due to this issue, I appreciate and thank in advance any help even though I realize it's a really niche use-case. Clicklockd is a open source tool that mimics a Windows accessibility feature known as Clicklock. It's the only public tool that does it correctly. As described by it's author, germag: "Clicklockd enables you to highlight or drag without holding down the mouse button. This feature allows you to hold the mouse button for a few seconds, move the mouse to the new location, and then click it again. The effect is the same as a drag and drop but without having to hold the mouse button for a long time." Instead of the expected behavior, clicks doesn't lock at all and single clicks are turned into double clicks. It works fine on Plasma X11 and other Wayland DE's/compositors like GNOME, and only depends on libudev, so the dev believies it's likely something related to how Plasma/kwin Wayland handles inputs. STEPS TO REPRODUCE 1. Build and run clicklockd (https://github.com/germag/clicklockd) OBSERVED RESULT . Clicklock won't work correctly and single clicks become double clicks instead. EXPECTED RESULT When we hold left click for x seconds, specified in argument like "-t 1.5s" passed to clicklockd, that click should be held on until another click comes in. SOFTWARE/OS VERSIONS KDE Plasma 6.0.4 on Arch Linux ADDITIONAL INFORMATION Github issue and discussion with developer: https://github.com/germag/clicklockd/issues/6
Can confirm. KWin is lacking the key press deduplication logic that's required for multiple devices on the same seat to cooperate with each other.
(In reply to Zamundaaa from comment #1) > Can confirm. KWin is lacking the key press deduplication logic that's > required for multiple devices on the same seat to cooperate with each other. Hey Zamundaaa, thanks for the quick confirmation. I got a bit of practical evidence on what's happening after playing a bit with libinput debug (sudo libinput debug-events --verbose) , along with clicklockd and also a script using python-evsieve to simulate my scenario. In summary, like you already said, the current issue in kwin Wayland behavior is that when the same key is pressed/released on multiple seats it lacks any logic to avoid repeating events to mess with each other. In my scenario what happens is this: -event4 POINTER_BUTTON +1.541s BTN_LEFT (272) pressed, seat count: 1 # Real mouse BTN_LEFT pressed, from neutral state - Self-explanatory -event15 POINTER_BUTTON +1.541s BTN_LEFT (272) pressed, seat count: 2 # Virtual mouse BTN_LEFT pressed - This click should be ignored since we're already in pressed state on another seat (real mouse), but it is not. It generates a double-click instead. -event4 POINTER_BUTTON +3.125s BTN_LEFT (272) released, seat count: 1 # Real mouse BTN_LEFT released - This one should also be ignored since virtual is still in pressed state, but it is not. event4 POINTER_BUTTON +4.589s BTN_LEFT (272) pressed, seat count: 2 # Real mouse BTN_LEFT pressed again - Also should be ignored since virtual is still in pressed state, but it is not. event4 POINTER_BUTTON +4.677s BTN_LEFT (272) released, seat count: 1 # Real mouse BTN_LEFT released - Also should be ignored since virtual is still in pressed state, but it is not. -event15 POINTER_BUTTON +4.677s BTN_LEFT (272) released, seat count: 0 # Virtual BTN_LEFT released - Now kwin/Plasma should actually release effectively. A bit difficult to explain, but something like this.
Here's some reference for expected multiseat behavior (from https://wayland.freedesktop.org/libinput/doc/latest/seats.html) if the same button is pressed on different devices, the button should only be considered logically pressed once. if the same button is released on one device, the button should be considered logically down if still down on another device. if two different buttons or keys are pressed on different devices, the logical state is that of both buttons/keys down. if a button is pressed on one device and another device moves, this should count as dragging. if two touches are down on different devices, the logical state is that of two touches down.
Hey, took a try at fixing this: https://invent.kde.org/plasma/kwin/-/merge_requests/5696
Git commit 998be47ac18123c2243c8d56546270acb4de0477 by Vlad Zahorodnii, on behalf of Bruno Filipe. Committed on 18/07/2024 at 06:56. Pushed by vladz into branch 'master'. backends/libinput: Ignore redundant events for pointer buttons and keyboard keys when pressed/released on multiple devices M +12 -0 src/backends/libinput/connection.cpp https://invent.kde.org/plasma/kwin/-/commit/998be47ac18123c2243c8d56546270acb4de0477
Git commit 73c8b3a2ddbb1fc3d50c0215967db325844be1ba by Vlad Zahorodnii, on behalf of Bruno Filipe. Committed on 18/07/2024 at 07:05. Pushed by vladz into branch 'Plasma/6.1'. backends/libinput: Ignore redundant events for pointer buttons and keyboard keys when pressed/released on multiple devices (cherry picked from commit 998be47ac18123c2243c8d56546270acb4de0477) M +12 -0 src/backends/libinput/connection.cpp https://invent.kde.org/plasma/kwin/-/commit/73c8b3a2ddbb1fc3d50c0215967db325844be1ba