<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Nov 22, 2012 at 10:34 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue, Nov 20, 2012 at 02:50:43PM -0500, Jasper St. Pierre wrote:<br>
> From: "Jasper St. Pierre" <<a href="mailto:jstpierre@mecheye.net">jstpierre@mecheye.net</a>><br>
><br>
> This adds support for clients that would like to get a notification<br>
> every time a barrier is released, along with a way to temporarily<br>
> release a barrier after it has been hit.<br>
><br>
> This adds two new events to XI: BarrierHitNotify and<br>
> BarrierPointerReleasedNotify.<br>
><br>
> Based on work by Chris Halse Rogers <<a href="mailto:chris.halse.rogers@canonical.com">chris.halse.rogers@canonical.com</a>><br>
><br>
> Signed-off-by: Jasper St. Pierre <<a href="mailto:jstpierre@mecheye.net">jstpierre@mecheye.net</a>><br>
> ---<br>
> Xi/exevents.c | 43 ++++++++++++++++++<br>
> Xi/extinit.c | 32 ++++++++++++++<br>
> Xi/xibarriers.c | 98 ++++++++++++++++++++++++++++++++++--------<br>
> Xi/xibarriers.h | 1 +<br>
> dix/getevents.c | 4 +-<br>
> hw/xfree86/modes/xf86RandR12.c | 4 +-<br>
> include/events.h | 1 +<br>
> include/eventstr.h | 22 ++++++++++<br>
> include/inputstr.h | 2 +-<br>
> include/protocol-versions.h | 2 +-<br>
> include/scrnintstr.h | 2 +-<br>
> mi/mieq.c | 3 ++<br>
> mi/mipointer.c | 12 ++++--<br>
> mi/mipointer.h | 4 +-<br>
> randr/randrstr.h | 2 +-<br>
> randr/rrcrtc.c | 4 +-<br>
> 16 files changed, 204 insertions(+), 32 deletions(-)<br>
><br>
> diff --git a/Xi/exevents.c b/Xi/exevents.c<br>
> index 4248b9a..98a2cee 100644<br>
> --- a/Xi/exevents.c<br>
> +++ b/Xi/exevents.c<br>
> @@ -1649,6 +1649,46 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)<br>
> UpdateDeviceState(dev, &ev->device_event);<br>
> }<br>
><br>
> +#define INT_TO_FP3232(x) ((FP3232) { (x), 0 })<br>
> +<br>
> +static void<br>
> +ProcessBarrierEvent(InternalEvent *e, DeviceIntPtr dev)<br>
> +{<br>
> + Mask filter;<br>
> + WindowPtr pWin;<br>
> + BarrierEvent *be = &e->barrier_event;<br>
> + xXIBarrierNotifyEvent ev = {<br>
> + .type = GenericEvent,<br>
> + .extension = IReqCode,<br>
> + .sequenceNumber = 0,<br>
> + .length = 9,<br>
> + .evtype = be->event_type,<br>
> + .window = be->window,<br>
> + .deviceid = dev->id,<br>
> + .time = be->time,<br>
> + .x = be->x,<br>
> + .y = be->y,<br>
> + .dx = INT_TO_FP3232(be->dx),<br>
> + .dy = INT_TO_FP3232(be->dy),<br>
> + .raw_dx = INT_TO_FP3232(be->raw_dx),<br>
> + .raw_dy = INT_TO_FP3232(be->raw_dy),<br>
> + .dt = be->dt,<br>
> + .event_id = be->event_id,<br>
> + .barrier = be->barrierid,<br>
> + };<br>
> +<br>
> + if (!IsMaster(dev))<br>
> + return;<br>
> +<br>
> + if (dixLookupWindow(&pWin, be->window, serverClient, DixReadAccess) != Success)<br>
> + return;<br>
> +<br>
> + filter = GetEventFilter(dev, (xEvent *) &ev);<br>
> +<br>
> + DeliverEventsToWindow(dev, pWin, (xEvent *) &ev, 1,<br>
> + filter, NullGrab);<br>
> +}<br>
> +<br>
> /**<br>
> * Process DeviceEvents and DeviceChangedEvents.<br>
> */<br>
> @@ -1798,6 +1838,9 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)<br>
> case ET_TouchEnd:<br>
> ProcessTouchEvent(ev, device);<br>
> break;<br>
> + case ET_BarrierNotify:<br>
> + ProcessBarrierEvent(ev, device);<br>
> + break;<br>
> default:<br>
> ProcessDeviceEvent(ev, device);<br>
> break;<br>
> diff --git a/Xi/extinit.c b/Xi/extinit.c<br>
> index 1074b23..6571943 100644<br>
> --- a/Xi/extinit.c<br>
> +++ b/Xi/extinit.c<br>
> @@ -840,6 +840,33 @@ STouchOwnershipEvent(xXITouchOwnershipEvent * from, xXITouchOwnershipEvent * to)<br>
> swapl(&to->child);<br>
> }<br>
><br>
> +static void<br>
> +SBarrierNotifyEvent(xXIBarrierNotifyEvent * from,<br>
> + xXIBarrierNotifyEvent * to) {<br>
> + to->type = from->type;<br>
> +<br>
> + cpswaps(from->x, to->x);<br>
> + cpswaps(from->y, to->y);<br>
> + cpswaps(from->dt, to->dt);<br>
> + cpswapl(from->length, to->length);<br>
> + cpswapl(from->time, to->time);<br>
> +<br>
> + cpswaps(from->event_id, to->event_id);<br>
> + cpswapl(from->barrier, to->barrier);<br>
> + cpswapl(from->window, to->window);<br>
> +<br>
> +#define SWAP_FP3232(x, y) \<br>
> + do { \<br>
> + cpswapl((x).integral, (y).integral); \<br>
> + cpswapl((x).frac, (y).frac); \<br>
> + } while(0)<br>
> +<br>
> + SWAP_FP3232(from->dx, to->dx);<br>
> + SWAP_FP3232(from->dy, to->dy);<br>
> + SWAP_FP3232(from->raw_dx, to->raw_dx);<br>
> + SWAP_FP3232(from->raw_dy, to->raw_dy);<br>
> +}<br>
> +<br>
> /** Event swapping function for XI2 events. */<br>
> void<br>
> XI2EventSwap(xGenericEvent *from, xGenericEvent *to)<br>
> @@ -886,6 +913,11 @@ XI2EventSwap(xGenericEvent *from, xGenericEvent *to)<br>
> case XI_RawTouchEnd:<br>
> SRawEvent((xXIRawEvent *) from, (xXIRawEvent *) to);<br>
> break;<br>
> + case XI_BarrierHitNotify:<br>
> + case XI_BarrierPointerReleasedNotify:<br>
> + SBarrierNotifyEvent((xXIBarrierNotifyEvent *) from,<br>
> + (xXIBarrierNotifyEvent *) to);<br>
> + break;<br>
> default:<br>
> ErrorF("[Xi] Unknown event type to swap. This is a bug.\n");<br>
> break;<br>
> diff --git a/Xi/xibarriers.c b/Xi/xibarriers.c<br>
> index a97db56..9b5f657 100644<br>
> --- a/Xi/xibarriers.c<br>
> +++ b/Xi/xibarriers.c<br>
> @@ -56,6 +56,8 @@<br>
> #include "xace.h"<br>
> #include "list.h"<br>
> #include "exglobals.h"<br>
> +#include "eventstr.h"<br>
> +#include "mi.h"<br>
><br>
> RESTYPE PointerBarrierType;<br>
><br>
> @@ -67,10 +69,16 @@ typedef struct PointerBarrierClient *PointerBarrierClientPtr;<br>
><br>
> struct PointerBarrierClient {<br>
> ScreenPtr screen;<br>
> + WindowPtr window;<br>
> struct PointerBarrier barrier;<br>
> struct xorg_list entry;<br>
> int num_devices;<br>
> int *device_ids; /* num_devices */<br>
> + Time last_timestamp;<br>
> + int barrier_event_id;<br>
> + int release_event_id;<br>
> + Bool hit;<br>
> + Bool last_hit;<br>
> };<br>
><br>
> typedef struct _BarrierScreen {<br>
> @@ -241,7 +249,7 @@ barrier_blocks_device(struct PointerBarrierClient *client,<br>
> }<br>
><br>
> /**<br>
> - * Find the nearest barrier that is blocking movement from x1/y1 to x2/y2.<br>
> + * Find the nearest barrier client that is blocking movement from x1/y1 to x2/y2.<br>
> *<br>
> * @param dir Only barriers blocking movement in direction dir are checked<br>
> * @param x1 X start coordinate of movement vector<br>
> @@ -250,13 +258,12 @@ barrier_blocks_device(struct PointerBarrierClient *client,<br>
> * @param y2 Y end coordinate of movement vector<br>
> * @return The barrier nearest to the movement origin that blocks this movement.<br>
> */<br>
> -static struct PointerBarrier *<br>
> +static struct PointerBarrierClient *<br>
> barrier_find_nearest(BarrierScreenPtr cs, DeviceIntPtr dev,<br>
> int dir,<br>
> int x1, int y1, int x2, int y2)<br>
> {<br>
> - struct PointerBarrierClient *c;<br>
> - struct PointerBarrier *nearest = NULL;<br>
> + struct PointerBarrierClient *c, *nearest = NULL;<br>
> double min_distance = INT_MAX; /* can't get higher than that in X anyway */<br>
><br>
> xorg_list_for_each_entry(c, &cs->barriers, entry) {<br>
> @@ -272,7 +279,7 @@ barrier_find_nearest(BarrierScreenPtr cs, DeviceIntPtr dev,<br>
> if (barrier_is_blocking(b, x1, y1, x2, y2, &distance)) {<br>
> if (min_distance > distance) {<br>
> min_distance = distance;<br>
> - nearest = b;<br>
> + nearest = c;<br>
> }<br>
> }<br>
> }<br>
> @@ -308,16 +315,26 @@ barrier_clamp_to_barrier(struct PointerBarrier *barrier, int dir, int *x,<br>
><br>
> static void<br>
> BarrierConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,<br>
> - int *x, int *y)<br>
> + int *x, int *y, int unclamped_x, int unclamped_y)<br>
> {<br>
> BarrierScreenPtr cs = GetBarrierScreen(screen);<br>
><br>
> if (!xorg_list_is_empty(&cs->barriers) && !IsFloating(dev) &&<br>
> mode == Relative) {<br>
> int ox, oy;<br>
> + int dx, dy;<br>
> int dir;<br>
> - int i;<br>
> struct PointerBarrier *nearest = NULL;<br>
> + PointerBarrierClientPtr c;<br>
> + Time ms = GetTimeInMillis();<br>
> + BarrierEvent ev = {<br>
> + .header = ET_Internal,<br>
> + .type = ET_BarrierNotify,<br>
> + .length = sizeof (BarrierEvent),<br>
> + .time = ms,<br>
> + .deviceid = dev->id,<br>
> + .sourceid = dev->id,<br>
> + };<br>
><br>
> /* where are we coming from */<br>
> miPointerGetPosition(dev, &ox, &oy);<br>
> @@ -330,29 +347,68 @@ BarrierConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode,<br>
> * destination, again finding the nearest barrier and clamping.<br>
> */<br>
> dir = barrier_get_direction(ox, oy, *x, *y);<br>
> + dx = unclamped_x - ox;<br>
> + dy = unclamped_y - oy;<br>
><br>
> #define MAX_BARRIERS 2<br>
> for (i = 0; i < MAX_BARRIERS; i++) {<br>
> - nearest = barrier_find_nearest(cs, dev, dir, ox, oy, *x, *y);<br>
> - if (!nearest)<br>
> + c = barrier_find_nearest(cs, dev, dir, ox, oy, *x, *y);<br>
> + if (!c)<br>
> break;<br>
><br>
> - barrier_clamp_to_barrier(nearest, dir, x, y);<br>
> + nearest = &c->barrier;<br>
><br>
> - if (barrier_is_vertical(nearest)) {<br>
> - dir &= ~(BarrierNegativeX | BarrierPositiveX);<br>
> - ox = *x;<br>
> + if (!c->last_hit) {<br>
> + /* This is the start of a new barrier event */<br>
> + c->barrier_event_id++;<br>
> }<br>
> - else if (barrier_is_horizontal(nearest)) {<br>
> - dir &= ~(BarrierNegativeY | BarrierPositiveY);<br>
> - oy = *y;<br>
> +<br>
> + if (c->barrier_event_id == c->release_event_id) {<br>
> + ev.event_type = XI_BarrierPointerReleasedNotify;<br>
> + } else {<br>
> + ev.event_type = XI_BarrierHitNotify;<br>
> +<br>
> + barrier_clamp_to_barrier(nearest, dir, x, y);<br>
> + c->hit = TRUE;<br>
> +<br>
> + if (barrier_is_vertical(nearest)) {<br>
> + dir &= ~(BarrierNegativeX | BarrierPositiveX);<br>
> + ox = *x;<br>
> + }<br>
> + else if (barrier_is_horizontal(nearest)) {<br>
> + dir &= ~(BarrierNegativeY | BarrierPositiveY);<br>
> + oy = *y;<br>
> + }<br>
> }<br>
> +<br>
> + ev.event_id = c->barrier_event_id;<br>
> + ev.barrierid = nearest->id;<br>
> +<br>
> + ev.x = *x;<br>
> + ev.y = *y;<br>
> + ev.dx = dx;<br>
> + ev.dy = dy;<br>
> +<br>
> + /* FIXME: add proper raw dx/dy */<br>
> + ev.raw_dx = dx;<br>
> + ev.raw_dy = dy;<br>
> +<br>
> + ev.dt = ms - c->last_timestamp;<br>
> + ev.window = c->window-><a href="http://drawable.id" target="_blank">drawable.id</a>;<br>
> + c->last_timestamp = ms;<br>
> +<br>
> + mieqEnqueue(dev, (InternalEvent *) &ev);<br>
> + }<br>
> +<br>
> + xorg_list_for_each_entry(c, &cs->barriers, entry) {<br>
> + c->last_hit = c->hit;<br>
> + c->hit = FALSE;<br>
> }<br>
> }<br>
><br>
> if (cs->ConstrainCursorHarder) {<br>
> screen->ConstrainCursorHarder = cs->ConstrainCursorHarder;<br>
> - screen->ConstrainCursorHarder(dev, screen, mode, x, y);<br>
> + screen->ConstrainCursorHarder(dev, screen, mode, x, y, unclamped_x, unclamped_y);<br>
> screen->ConstrainCursorHarder = BarrierConstrainCursorHarder;<br>
> }<br>
> }<br>
> @@ -378,7 +434,7 @@ CreatePointerBarrierClient(ClientPtr client,<br>
> return BadAlloc;<br>
> }<br>
><br>
> - err = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);<br>
> + err = dixLookupWindow(&pWin, stuff->window, client, DixSendAccess);<br>
<br>
</div></div>I don't think this needs to be changed. the window is just used as reference<br>
for creating the barrier, the send access is handled during normal event<br>
processing.<br>
<br>
but do I read this right that the window is also the one the events are<br>
being sent to? if so, the spec needs changing, right now we only require<br>
drawables (which could be a pixmap), not a valid window. and that only for<br>
retrieving the screen.<br>
<br>
(I also noticed that your github branch inputproto didn't have updated<br>
specs, so the behaviour is a bit of guesswork here)<br></blockquote><div><br>Noted; will do.<br><br>inputproto doesn't have any specs - I still was a bit cautious about updating things like this because I'm not sure how the specs between fixes and input should interact.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
does a client need to select for XI_BarrierHitNotify separately?</blockquote><div><br>Separately from what? If they want to receive barrier hit notify events, they need to select the input, yes.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and do so
on the window specified here?</blockquote><div><br>Of course. The events are sent to this window, not to any others.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
what happens if a client selects for that<br>
event on another window? </blockquote><div><br> They get any and all barrier events for that window.<br><br>I did this approach because people told me that we didn't want another XSync Global Alarms case, and events should always be sent to windows.<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
> if (err != Success) {<br>
> client->errorValue = stuff->window;<br>
> goto error;<br>
> @@ -388,6 +444,7 @@ CreatePointerBarrierClient(ClientPtr client,<br>
> cs = GetBarrierScreen(screen);<br>
><br>
> ret->screen = screen;<br>
> + ret->window = pWin;<br>
> ret->num_devices = stuff->num_devices;<br>
> if (ret->num_devices > 0)<br>
> ret->device_ids = (int*)&ret[1];<br>
> @@ -414,6 +471,11 @@ CreatePointerBarrierClient(ClientPtr client,<br>
> ret->device_ids[i] = device_id;<br>
> }<br>
><br>
> + ret-><a href="http://barrier.id" target="_blank">barrier.id</a> = stuff->barrier;<br>
> + ret->barrier_event_id = 0;<br>
> + ret->release_event_id = 0;<br>
> + ret->hit = FALSE;<br>
> + ret->last_hit = FALSE;<br>
> ret->barrier.x1 = min(stuff->x1, stuff->x2);<br>
> ret->barrier.x2 = max(stuff->x1, stuff->x2);<br>
> ret->barrier.y1 = min(stuff->y1, stuff->y2);<br>
> diff --git a/Xi/xibarriers.h b/Xi/xibarriers.h<br>
> index 8f2993f..91a0756 100644<br>
> --- a/Xi/xibarriers.h<br>
> +++ b/Xi/xibarriers.h<br>
> @@ -11,6 +11,7 @@<br>
> extern _X_EXPORT RESTYPE PointerBarrierType;<br>
><br>
> struct PointerBarrier {<br>
> + XID id;<br>
> CARD16 x1, x2, y1, y2;<br>
> CARD32 directions;<br>
> };<br>
> diff --git a/dix/getevents.c b/dix/getevents.c<br>
> index 2a686e8..6f17534 100644<br>
> --- a/dix/getevents.c<br>
> +++ b/dix/getevents.c<br>
> @@ -933,7 +933,9 @@ positionSprite(DeviceIntPtr dev, int mode, ValuatorMask *mask,<br>
> /* miPointerSetPosition takes care of crossing screens for us, as well as<br>
> * clipping to the current screen. Coordinates returned are in desktop<br>
> * coord system */<br>
> - scr = miPointerSetPosition(dev, mode, screenx, screeny);<br>
> + scr = miPointerSetPosition(dev, mode, screenx, screeny,<br>
> + (int)floor(*screenx) - scr->x,<br>
> + (int)floor(*screeny) - scr->y);<br>
><br>
> /* If we were constrained, rescale x/y from the screen coordinates so<br>
> * the device valuators reflect the correct position. For screen<br>
> diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c<br>
> index 3530abf..55cfbd9 100644<br>
> --- a/hw/xfree86/modes/xf86RandR12.c<br>
> +++ b/hw/xfree86/modes/xf86RandR12.c<br>
> @@ -1871,7 +1871,7 @@ xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap)<br>
> }<br>
><br>
> static void<br>
> -xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y)<br>
> +xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, int *x, int *y, int unclamped_x, int unclamped_y)<br>
> {<br>
> XF86RandRInfoPtr randrp = XF86RANDRINFO(screen);<br>
><br>
> @@ -1880,7 +1880,7 @@ xf86RandR13ConstrainCursorHarder(DeviceIntPtr dev, ScreenPtr screen, int mode, i<br>
><br>
> if (randrp->orig_ConstrainCursorHarder) {<br>
> screen->ConstrainCursorHarder = randrp->orig_ConstrainCursorHarder;<br>
> - screen->ConstrainCursorHarder(dev, screen, mode, x, y);<br>
> + screen->ConstrainCursorHarder(dev, screen, mode, x, y, unclamped_x, unclamped_y);<br>
> screen->ConstrainCursorHarder = xf86RandR13ConstrainCursorHarder;<br>
> }<br>
> }<br>
> diff --git a/include/events.h b/include/events.h<br>
> index 222bf32..c0ef45d 100644<br>
> --- a/include/events.h<br>
> +++ b/include/events.h<br>
> @@ -27,6 +27,7 @@<br>
> typedef struct _DeviceEvent DeviceEvent;<br>
> typedef struct _DeviceChangedEvent DeviceChangedEvent;<br>
> typedef struct _TouchOwnershipEvent TouchOwnershipEvent;<br>
> +typedef struct _BarrierEvent BarrierEvent;<br>
><br>
> #if XFreeXDGA<br>
> typedef struct _DGAEvent DGAEvent;<br>
> diff --git a/include/eventstr.h b/include/eventstr.h<br>
> index dd6fbef..176bac0 100644<br>
> --- a/include/eventstr.h<br>
> +++ b/include/eventstr.h<br>
> @@ -72,6 +72,7 @@ enum EventType {<br>
> ET_RawTouchUpdate,<br>
> ET_RawTouchEnd,<br>
> ET_XQuartz,<br>
> + ET_BarrierNotify,<br>
> ET_Internal = 0xFF /* First byte */<br>
> };<br>
><br>
> @@ -227,6 +228,26 @@ struct _RawDeviceEvent {<br>
> uint32_t flags; /**< Flags to be copied into the generated event */<br>
> };<br>
><br>
> +struct _BarrierEvent {<br>
> + unsigned char header; /**< Always ET_Internal */<br>
> + enum EventType type; /**< ET_BarrierNotify */<br>
> + int length; /**< Length in bytes */<br>
> + Time time; /**< Time in ms */<br>
> + int deviceid; /**< Device to post this event for */<br>
> + int sourceid; /**< The physical source device */<br>
> + int barrierid;<br>
> + Window window;<br>
> + int16_t x;<br>
> + int16_t y;<br>
> + int32_t dx;<br>
> + int32_t dy;<br>
> + int32_t raw_dx;<br>
> + int32_t raw_dy;<br>
> + int16_t dt;<br>
> + int16_t event_type;<br>
> + int32_t event_id;<br>
> +};<br>
> +<br>
> #ifdef XQUARTZ<br>
> #define XQUARTZ_EVENT_MAXARGS 5<br>
> struct _XQuartzEvent {<br>
> @@ -253,6 +274,7 @@ union _InternalEvent {<br>
> DeviceEvent device_event;<br>
> DeviceChangedEvent changed_event;<br>
> TouchOwnershipEvent touch_ownership_event;<br>
> + BarrierEvent barrier_event;<br>
> #if XFreeXDGA<br>
> DGAEvent dga_event;<br>
> #endif<br>
> diff --git a/include/inputstr.h b/include/inputstr.h<br>
> index 5a38924..e4240c9 100644<br>
> --- a/include/inputstr.h<br>
> +++ b/include/inputstr.h<br>
> @@ -71,7 +71,7 @@ extern _X_EXPORT int CountBits(const uint8_t * mask, int len);<br>
> * events to the protocol, the server will not support these events until<br>
> * this number here is bumped.<br>
> */<br>
> -#define XI2LASTEVENT XI_RawTouchEnd<br>
> +#define XI2LASTEVENT XI_BarrierPointerReleasedNotify<br>
> #define XI2MASKSIZE ((XI2LASTEVENT >> 3) + 1) /* no of bytes for masks */<br>
><br>
> /**<br>
> diff --git a/include/protocol-versions.h b/include/protocol-versions.h<br>
> index cb8e213..10f5117 100644<br>
> --- a/include/protocol-versions.h<br>
> +++ b/include/protocol-versions.h<br>
> @@ -127,7 +127,7 @@<br>
><br>
> /* X Input */<br>
> #define SERVER_XI_MAJOR_VERSION 2<br>
> -#define SERVER_XI_MINOR_VERSION 2<br>
> +#define SERVER_XI_MINOR_VERSION 3<br>
<br>
</div></div>This must be a separate commit, not hidden here.<br>
<div class="im"><br>
><br>
> /* XKB */<br>
> #define SERVER_XKB_MAJOR_VERSION 1<br>
> diff --git a/include/scrnintstr.h b/include/scrnintstr.h<br>
> index df74073..095b029 100644<br>
> --- a/include/scrnintstr.h<br>
> +++ b/include/scrnintstr.h<br>
> @@ -339,7 +339,7 @@ typedef void (*DeviceCursorCleanupProcPtr) (DeviceIntPtr /* pDev */ ,<br>
> ScreenPtr /* pScreen */ );<br>
><br>
> typedef void (*ConstrainCursorHarderProcPtr) (DeviceIntPtr, ScreenPtr, int,<br>
> - int *, int *);<br>
> + int *, int *, int, int);<br>
<br>
</div>Please split the changes related to this out from the actual event stuff.<br><div><div class="h5"></div></div></blockquote><div><br>Will dol thanks.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="h5">
><br>
> typedef Bool (*SharePixmapBackingProcPtr)(PixmapPtr, ScreenPtr, void **);<br>
> diff --git a/mi/mieq.c b/mi/mieq.c<br>
> index b2c7769..102fe95 100644<br>
> --- a/mi/mieq.c<br>
> +++ b/mi/mieq.c<br>
> @@ -407,6 +407,9 @@ ChangeDeviceID(DeviceIntPtr dev, InternalEvent *event)<br>
> case ET_RawTouchUpdate:<br>
> event->raw_event.deviceid = dev->id;<br>
> break;<br>
> + case ET_BarrierNotify:<br>
> + event->barrier_event.deviceid = dev->id;<br>
> + break;<br>
> default:<br>
> ErrorF("[mi] Unknown event type (%d), cannot change id.\n",<br>
> event->any.type);<br>
> diff --git a/mi/mipointer.c b/mi/mipointer.c<br>
> index f345063..b440fd1 100644<br>
> --- a/mi/mipointer.c<br>
> +++ b/mi/mipointer.c<br>
> @@ -271,7 +271,7 @@ miPointerSetCursorPosition(DeviceIntPtr pDev, ScreenPtr pScreen,<br>
> pPointer->generateEvent = generateEvent;<br>
><br>
> if (pScreen->ConstrainCursorHarder)<br>
> - pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y);<br>
> + pScreen->ConstrainCursorHarder(pDev, pScreen, Absolute, &x, &y, 0, 0);<br>
><br>
> /* device dependent - must pend signal and call miPointerWarpCursor */<br>
> (*pScreenPriv->screenFuncs->WarpCursor) (pDev, pScreen, x, y);<br>
> @@ -562,10 +562,13 @@ miPointerMoveNoEvent(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)<br>
> * @param mode Movement mode (Absolute or Relative)<br>
> * @param[in,out] screenx The x coordinate in desktop coordinates<br>
> * @param[in,out] screeny The y coordinate in desktop coordinates<br>
> + * @param unclamped_x The unclamped x coordinate in screen coordinates<br>
> + * @param unclamped_x The unclamped y coordinate in screen coordinates<br>
<br>
</div></div>if you can avoid it, please don't. we already have 3 or 4 coordinate<br>
systems, if possible please let's keep everything in the desktop coordinate<br>
system. Conversion isn't that hard (screen->x + x) but remembering which<br>
coordinate is in which system is already confusing.<br>
<br>
Also, please define unclamped, since the casual reader won't know what's<br>
clamping.<br>
<br>
Cheers,<br>
Peter<br>
<div><div class="h5"><br>
> */<br>
> ScreenPtr<br>
> -miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,<br>
> - double *screeny)<br>
> +miPointerSetPosition(DeviceIntPtr pDev, int mode,<br>
> + double *screenx, double *screeny,<br>
> + int unclamped_x, int unclamped_y)<br>
> {<br>
> miPointerScreenPtr pScreenPriv;<br>
> ScreenPtr pScreen;<br>
> @@ -614,7 +617,8 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,<br>
> y = pPointer->limits.y2 - 1;<br>
><br>
> if (pScreen->ConstrainCursorHarder)<br>
> - pScreen->ConstrainCursorHarder(pDev, pScreen, mode, &x, &y);<br>
> + pScreen->ConstrainCursorHarder(pDev, pScreen, mode, &x, &y,<br>
> + unclamped_x, unclamped_y);<br>
><br>
> if (pPointer->x != x || pPointer->y != y || pPointer->pScreen != pScreen)<br>
> miPointerMoveNoEvent(pDev, pScreen, x, y);<br>
> diff --git a/mi/mipointer.h b/mi/mipointer.h<br>
> index 1500e21..9d008f4 100644<br>
> --- a/mi/mipointer.h<br>
> +++ b/mi/mipointer.h<br>
> @@ -115,7 +115,9 @@ miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y);<br>
> /* Moves the cursor to the specified position. May clip the co-ordinates:<br>
> * x and y are modified in-place. */<br>
> extern _X_EXPORT ScreenPtr<br>
> -miPointerSetPosition(DeviceIntPtr pDev, int mode, double *x, double *y);<br>
> +miPointerSetPosition(DeviceIntPtr pDev, int mode,<br>
> + double *x, double *y,<br>
> + int unclamped_x, int unclamped_y);<br>
><br>
> extern _X_EXPORT void<br>
> miPointerUpdateSprite(DeviceIntPtr pDev);<br>
> diff --git a/randr/randrstr.h b/randr/randrstr.h<br>
> index a16302f..1cc4dfd 100644<br>
> --- a/randr/randrstr.h<br>
> +++ b/randr/randrstr.h<br>
> @@ -704,7 +704,7 @@ int<br>
> ProcRRSetPanning(ClientPtr client);<br>
><br>
> void<br>
> - RRConstrainCursorHarder(DeviceIntPtr, ScreenPtr, int, int *, int *);<br>
> + RRConstrainCursorHarder(DeviceIntPtr, ScreenPtr, int, int *, int *, int, int);<br>
><br>
> /* rrdispatch.c */<br>
> extern _X_EXPORT Bool<br>
> diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c<br>
> index e82d050..d0eb8dd 100644<br>
> --- a/randr/rrcrtc.c<br>
> +++ b/randr/rrcrtc.c<br>
> @@ -1613,8 +1613,8 @@ static Bool constrain_all_screen_crtcs(DeviceIntPtr pDev, ScreenPtr pScreen, int<br>
> }<br>
><br>
> void<br>
> -RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode, int *x,<br>
> - int *y)<br>
> +RRConstrainCursorHarder(DeviceIntPtr pDev, ScreenPtr pScreen, int mode,<br>
> + int *x, int *y, int unclamped_x, int unclamped_y)<br>
> {<br>
> rrScrPriv(pScreen);<br>
> Bool ret;<br>
> --<br>
> 1.8.0<br>
><br>
</div></div>> _______________________________________________<br>
> <a href="mailto:xorg-devel@lists.x.org">xorg-devel@lists.x.org</a>: X.Org development<br>
> Archives: <a href="http://lists.x.org/archives/xorg-devel" target="_blank">http://lists.x.org/archives/xorg-devel</a><br>
> Info: <a href="http://lists.x.org/mailman/listinfo/xorg-devel" target="_blank">http://lists.x.org/mailman/listinfo/xorg-devel</a><br>
><br>
</blockquote></div><br><br clear="all"><br>-- <br> Jasper<br><br>
</div>