Weston: Touch failing when using libinput

Cooper Jr., Franklin fcooper at ti.com
Sun Aug 17 07:30:44 PDT 2014


I've made progress and I'm pretty sure what the problem is and trying to see how to properly fix things.
Also my system is using a resistive touchscreen. I'm not sure how cap touch screens are handled.

Weston without Libinput

Weston/src/evdev.c
Before transform_absolute (calibration) is called device->abs.x and device->abs.y have already been converted from ADC values to pixels.

Weston using libinput

Libinput receives the touch event then runs transform_absolute (calibration) and passes the correct touch event to Weston. Weston before sending the touch information to others calls libinput_event_pointer_get_absolute_x/y_transformed which converts the ADC value to proper x/y coordinates/pixels. It then calls handle_pointer_motion_absolute and the touch event along with x and y values are propagated to the rest of the system.

Now the problem with the above is the calibration functions expect coordinates/pixels and not ADC values. So the calibrated values ends up being very large or even negative. So the reason why I way always getting a null view/never getting focus was the x and y value used to determine which view was "touched" was off the screen.


I believe the proper fix would be to insure that Libinput converts the ADC values to pixels, calibrates the values and then pass the transformed + calibrated values to Weston.


________________________________
From: Cooper Jr., Franklin
Sent: Saturday, August 16, 2014 4:01 PM
To: wayland-devel at lists.freedesktop.org
Subject: Weston: Touch failing when using libinput

On an embedded device I have Wayland and Weston working fine with my touchscreen. After calibration I am able to use apps such as weston-simple-touch but Qt 5 using Wayland doesn't recognize any touch inputs (connecting a mouse works fine).

To fix my Qt 5 (QtWayland) issue I switched to using the latest version of Weston , Wayland and QtWayland and I saw the same behavior as I saw before. Based on bugs filed by other people it seems I needed Weston to send WL_TOUCH_FRAME which the latest Weston doesn't send but the latest libinput currently supports.

I rebuilt Weston with "--enable-libinput-backend" and built and installed the latest libinput and now touch isn't working with Wayland/Weston.

I did alot of debugging and currently I know that libinput is properly recognizing and passing my touch messages to Weston. Weston is currently recognizing the touch messages. However, in src/input.c (Weston) notify_touch is receiving the proper WL_TOUCH_DOWN,WL_TOUCH_MOTION and WL_TOUCH_UP events.  WL_TOUCH_DOWN after detecting the first touch point calls weston_compositor_pick_view but null is always returned. This null view is then passed to weston_touch_set_focus which associates null with the seat. When moving your finger WL_TOUCH_MOTION is processed within notify_touch and it tries to retrieve the current view that is in focus "ev = touch->focus". However due to the previous call to weston_touch_set_focus their is no current view in focus so the break statement is executed which means the motion event isn't processed. So the inability to determine which view is being focused on is what causing my touch inputs not to be passed to the app such as weston-simple-touch.

What I don't understand is why am I not having this problem when switching to libinput when without it atleast Wayland and Weston is working correctly? Any suggestions on how to debug this issue any further?
^ I mean't why I am having this problem


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20140817/74debff1/attachment.html>


More information about the wayland-devel mailing list