slint icon indicating copy to clipboard operation
slint copied to clipboard

Touch release events are delivered too late with Wayland and certain Weston versions

Open qarmin opened this issue 1 year ago • 11 comments
trafficstars

Slint 1.4.1 - 09a5c724bf3ba6e60acfb8ca6c6f3b2f14ee696d

In gallery example and other app, when I click at any item nothing happens, but when I again anywhere, then first operation ends and second starts to wait for something.

https://github.com/slint-ui/slint/assets/41945903/31e83baa-d13f-4e34-8733-b43446c85b50

In video is visible in 0:02, that first tab was clicked, but I had to to click at empty space to go to first tab.

At end is visible that I change tabs, but this works with 1 click lag and show not latest clicked item

Weston - 9.0.0

CPU

Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  1
Core(s) per socket:  4
Socket(s):           1
Vendor ID:           ARM
Model:               10
Model name:          Cortex-A9
Stepping:            r2p10
CPU max MHz:         852.0000
CPU min MHz:         396.0000
BogoMIPS:            6.45
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpd32

OS - yocto, self compiled

5.10.52-lts-5.10.y+g60acdb561851 #1 SMP PREEMPT Wed Sep 8 10:41:11 UTC 2021 armv7l armv7l armv7l GNU/Linux

This was cross-compiled via

cross build --target armv7-unknown-linux-gnueabihf --release

after removing gettext feature

qarmin avatar Feb 06 '24 10:02 qarmin

Thanks for the report :) Do you know if this is running with X11, Wayland, or directly on the frame buffer?

tronical avatar Feb 06 '24 10:02 tronical

It runs wayland - weston compositor

qarmin avatar Feb 06 '24 10:02 qarmin

Thanks. That's really odd. It sounds like a bug in the touch input handling somehow.

tronical avatar Feb 06 '24 10:02 tronical

Just out of curiosity: If you attach a USB mouse to the same device, can you reproduce the same issue with the mouse pointer and mouse clicks, or is it just touch?

tronical avatar Feb 06 '24 10:02 tronical

Problem not happens when using mouse

qarmin avatar Feb 06 '24 10:02 qarmin

I tried to reproduce this on an stm32mp157-dk2 running ST's yocto linux with Weston. Unfortunately I can't reproduce the issue there.

Could you try to compile with --features slint/backend-linuxkms-noseat and try to run it without wayland/Weston and see if the issue happens then, too?

tronical avatar Feb 06 '24 16:02 tronical

I don't often have physical access to the this hardware (I do have remote access, but that's not an option in this case), so unfortunately I won't be able to check until the next few days.

qarmin avatar Feb 07 '24 07:02 qarmin

I can reproduce this now on a imx8.

tronical avatar Feb 26 '24 17:02 tronical

I observe the following event delivery from winit for two clicks at different locations (let's say (a) and (b)):

  • touch start at a
  • when the finger is lifted, nothing happens
  • when the finger is touched down on b, first we get touch release at a, then we get touch start at b

With WAYLAND_DEBUG=1 set, I can see that from the compositor we do receive a [email protected] event, so it looks like winit swallows that somehow.

tronical avatar Feb 27 '24 14:02 tronical

Phew, it seems that sctk (correctly so) accumulates touch up/down/etc. events until a touch frame event is received. With the setup in question, the frame event is received before the up:

[2622490.847] [email protected](189, 11764147, wl_surface@21, 0, 147.00000000, 158.00000000)
[2622490.986] [email protected]()
[2622614.046] [email protected](190, 11764270, 0)

That's why up is processed only on the next down, since that comes with another frame.

tronical avatar Feb 27 '24 15:02 tronical

I've submitted a workaround at https://github.com/Smithay/client-toolkit/pull/444

tronical avatar Feb 28 '24 11:02 tronical