feat: add touch input support#888
Conversation
Originally authored by Ching Pei Yang (horriblename) <badnam3o.0@gmail.com> based on dwl-patches/touch-input: https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/touch-input/touch-input.patch Initial patch changes: - removed duplicate declaration of `createtouch` - touch motion events now track the surface detected at touch down, rather than whatever surface is under the finger at motion time Subsequent fixes and improvements: - fix: prevent client focus loss on touch interaction with layer surfaces - fix: correct emulation of cursor pointer from unhandled touch events - opt: hide cursor on touchdown - fix: prevent crash when touch motion occurs over layer surfaces - fix: use scene node coordinates for touch motion events - opt: remove sloppyfocus guards from touch focus - opt: handle touch_cancel event - fix: drop events for cancelled touch points - fix: correct touch motion surface-local coordinate calculation Co-authored-by: Ching Pei Yang <badnam3o.0@gmail.com>
|
is the cursor being hidden while using the touchscreen the expected behaviour? |
yes |
max-amb
left a comment
There was a problem hiding this comment.
Checked this change out locally on my machine and everything seems to be working as intended. This is on the main branch with the pr. Thank you for this 😀.
If anyone wants to test it out on NixOS you can make a fork, pull this pr into the fork and then update your flake input to your fork.
|
I noticed that after a Stylus is used, touch input is blocked until you restart mango. When i try to use the touchscreen after coming close to the screen with my stylus, libinput debug outputs: event5 - dropping events due to touch arbitration. (Lenovo Yoga 2 in 1, Nixos) |
|
I think stylus support is a separate issue, to be implemented by: https://codeberg.org/dwl/dwl-patches/src/branch/main/patches/tablet-input. My stylus doesn't work with this touch patch, but I have a working prototype with this tablet-input patch. I wonder why your stylus works with this patch, I don't know. |
|
i'm on werapea's combined branch, not just the touch-pr |
|
Oh I see, I don't know then sorry. |
touch arbitration is handled by libinput and should only be active during stylus proximity. Compositor only receives touch cancel events on proximity in, after that any new touch events it receives are unaffected, and arbitration should stop after proximity out, so the problem lies on libinput side with how your device handles proximity events or touch arbitration in general. |
|
Oh, okay. Was on Plasma 6 before and there it worked fine, so I thought it may be something with wlroots (tried niri just now and there the issue reappeared) |
|
The issue was fixed in libinput 1.30.x/1.31.1 (nixpkgs-unstable still is on 1.29.2 so you would have to make an overlay until they merge it) |
Could it be made a compile time flag and disabled on nix until fixed? |
|
one thing that's missing is interactions in the overview. currently touching a window in overview mode will focus the window but not exit overview mode, you still have to get a mouse out for that |
|
@DreamMaoMao thanks for the new update, I'll be sending a donation. Can't wait for the touch support though, a very needed feature for my line of work |
thanks,I'll consider it, but I don't have any extra money to purchase these devices now. |
c009ba2 to
f328c27
Compare
Originally authored by @horriblename based on dwl-patches/touch-input: #426
Initial patch changes:
createtouchSubsequent fixes and improvements: