summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-12-03 10:41:16 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-12-17 15:03:12 +1000
commit21a15f9a04ec0a6c8f654eef943561e98db2475d (patch)
treeb4e799b2138d5b2b1a5f4a8a62ed794bb52c1c6c /Xi
parent707b4dc61f18960611409ef5ad8947be189f7296 (diff)
Pass the event list through to the pointer barrier code to return it
Instead of having the pointer barrier code enqueue events separately from GetPointerEvents, pass the event list through and let it add to it. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/xibarriers.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c
index 27b21eedb..104280c62 100644
--- a/Xi/xibarriers.c
+++ b/Xi/xibarriers.c
@@ -335,7 +335,8 @@ void
input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
int current_x, int current_y,
int dest_x, int dest_y,
- int *out_x, int *out_y)
+ int *out_x, int *out_y,
+ int *nevents, InternalEvent* events)
{
/* Clamped coordinates here refer to screen edge clamping. */
BarrierScreenPtr cs = GetBarrierScreen(screen);
@@ -356,6 +357,10 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
.dy = dest_y - current_y,
.root = screen->root->drawable.id,
};
+ InternalEvent *barrier_events = events;
+
+ if (nevents)
+ *nevents = 0;
if (xorg_list_is_empty(&cs->barriers) || IsFloating(dev))
goto out;
@@ -402,7 +407,9 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
ev.window = c->window->drawable.id;
c->last_timestamp = ms;
- mieqEnqueue(dev, (InternalEvent *) &ev);
+ barrier_events->barrier_event = ev;
+ barrier_events++;
+ *nevents += 1;
}
xorg_list_for_each_entry(c, &cs->barriers, entry) {
@@ -429,7 +436,9 @@ input_constrain_cursor(DeviceIntPtr dev, ScreenPtr screen,
ev.window = c->window->drawable.id;
c->last_timestamp = ms;
- mieqEnqueue(dev, (InternalEvent *) &ev);
+ barrier_events->barrier_event = ev;
+ barrier_events++;
+ *nevents += 1;
/* If we've left the hit box, this is the
* start of a new event ID. */