[PATCH 1/1] evdev: Wait for SYN event before sending events over to the client

Singh, Satyeshwar satyeshwar.singh at intel.com
Fri Feb 22 10:56:38 PST 2013


The issue was that touch::down event from the compositor to client apps
would send the previous motion events coordinates and this obviously made
the client do the wrong thing. This happened because we were not waiting for
a SYN event to come from evdev before sending down, motion or up events.

This commit should fix: https://bugs.freedesktop.org/show_bug.cgi?id=51909

---

src/evdev.c | 7 ++++++-

src/evdev.h | 1 +

2 files changed, 7 insertions(+), 1 deletion(-)

 

diff --git a/src/evdev.c b/src/evdev.c

index 286543a..72ca2f2 100644

--- a/src/evdev.c

+++ b/src/evdev.c

@@ -249,9 +249,11 @@ evdev_flush_motion(struct evdev_device *device,
uint32_t time)

{

           struct weston_seat *master = device->seat;

-           if (!device->pending_events)

+          if (!device->pending_events || !(device->pending_events &
EVDEV_SYN))

                       return;

+          device->pending_events &= ~EVDEV_SYN;

+

           if (device->pending_events & EVDEV_RELATIVE_MOTION) {

                       notify_motion(master, time,

                                         master->seat.pointer->x +
device->rel.dx,

@@ -308,6 +310,9 @@ fallback_process(struct evdev_dispatch *dispatch,

           case EV_KEY:

                       evdev_process_key(device, event, time);

                       break;

+          case EV_SYN:

+                      device->pending_events |= EVDEV_SYN;

+                      break;

           }

}

diff --git a/src/evdev.h b/src/evdev.h

index ccbb222..eb5c868 100644

--- a/src/evdev.h

+++ b/src/evdev.h

@@ -34,6 +34,7 @@ enum evdev_event_type {

           EVDEV_ABSOLUTE_MT_MOTION = (1 << 2),

           EVDEV_ABSOLUTE_MT_UP = (1 << 3),

           EVDEV_RELATIVE_MOTION = (1 << 4),

+          EVDEV_SYN = (1 << 5),

};

 enum evdev_device_capability {

-- 

1.7.11.4

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130222/d74fdcc5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 8662 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20130222/d74fdcc5/attachment-0001.bin>


More information about the wayland-devel mailing list