[PATCH v2 3/12] Xi: Add support for confine_to on XI 2.1 XIPassiveGrab requests.
Daniel Stone
daniel at fooishbar.org
Mon Jun 6 06:34:20 PDT 2011
Hi,
On Fri, Jun 03, 2011 at 12:45:01PM +1000, Peter Hutterer wrote:
> diff --git a/Xi/xigrabdev.h b/Xi/xigrabdev.h
> index 08309c9..2f74788 100644
> --- a/Xi/xigrabdev.h
> +++ b/Xi/xigrabdev.h
> @@ -38,4 +38,6 @@ int SProcXIUngrabDevice(ClientPtr client);
>
> void SRepXIGrabDevice(ClientPtr client, int size, xXIGrabDeviceReply * rep);
>
> +Bool HasConfineTo(ClientPtr client);
> +
> #endif /* XIGRABDEV_H */
If this is now non-static, a less ambiguous name would be nice.
> +/**
> + * The confine_to window in XI2.1 trails the request. It is the first 4
> + * bytes after the fixed request + the mask bytes + modifier bytes.
> + * Mask and modifiers are both in 4-byte units.
> + *
> + * @return A pointer to the 4 bytes that represent the confine_to on the
> + * wire.
> + */
> +static Window*
> +get_confine_to(const xXIPassiveGrabDeviceReq *req)
> +{
> + char *data = (char*)&req[1] + req->mask_len * 4 + req->num_modifiers * 4;
> + return (Window*)data;
> +}
Disambiguating this name would be pretty keen as well, since we now have
two get_confine_tos. Also, there's an extraneous space in the return
statement.
Cheers,
Daniel
More information about the xorg-devel
mailing list