From: "Jasper St. Pierre" <[email protected]>

Additionally, add flags when the pointer is released.

Signed-off-by: Peter Hutterer <[email protected]>
---
 Xi/xibarriers.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 45e97cf..75ea4f7 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -417,6 +417,7 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
     }
 
     xorg_list_for_each_entry(c, &cs->barriers, entry) {
+        int flags = 0;
         c->seen = FALSE;
         if (!c->hit)
             continue;
@@ -425,6 +426,22 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
             continue;
 
         c->hit = FALSE;
+
+        ev.type = ET_BarrierLeave;
+
+        if (c->barrier_event_id == c->release_event_id)
+            flags |= XIBarrierPointerReleased;
+
+        ev.flags = flags;
+        ev.event_id = c->barrier_event_id;
+        ev.barrierid = c->id;
+
+        ev.dt = ms - c->last_timestamp;
+        ev.window = c->window->drawable.id;
+        c->last_timestamp = ms;
+
+        mieqEnqueue(dev, (InternalEvent *) &ev);
+
         /* If we've left the hit box, this is the
          * start of a new event ID. */
         c->barrier_event_id++;
-- 
1.8.0.1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to