[PATCH weston] evdev-touchpad: Configure flags so device is treated as a pointer.

Scott Moreau oreaus at gmail.com
Mon Aug 6 05:12:52 PDT 2012


A touchpad sends absolute events but they are translated to relative events
by evdev-touchpad before sending to the compositor. The device is treated as a
pointer and the flags should reflect this.
---

This might be one way to do what Jonas is talking about. The capabilities enum
should reflect how the compositor treats the device, or put another way, what
type of events are expected when they reach the compositor. The current code
marks touchpad devices as both pointer and touch. This should make it so it's
detected as a pointer device.

 src/evdev-touchpad.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/evdev-touchpad.c b/src/evdev-touchpad.c
index f613fb9..563b6e6 100644
--- a/src/evdev-touchpad.c
+++ b/src/evdev-touchpad.c
@@ -529,6 +529,11 @@ evdev_touchpad_create(struct evdev_input_device *device)
 
 	touchpad->base.interface = &touchpad_interface;
 
+	device->caps &= ~EVDEV_MOTION_ABS;
+	device->caps &= ~EVDEV_TOUCH;
+
+	device->caps |= EVDEV_MOTION_REL;
+	
 	touchpad->device = device;
 	wl_list_init(&touchpad->motion_filters);
 
-- 
1.7.11.2



More information about the wayland-devel mailing list