[PATCH libXi] WireToEvent: Set display member of all events as well

Peter Hutterer peter.hutterer at who-t.net
Mon Dec 13 19:40:37 PST 2010


On Mon, Dec 13, 2010 at 07:51:59PM +0000, Daniel Stone wrote:
> All events were getting random uninitialised garbage for display; fix
> that.
> 
> Signed-off-by: Daniel Stone <daniel at fooishbar.org>
> ---
>  src/XExtInt.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/src/XExtInt.c b/src/XExtInt.c
> index a1ade31..9f995b6 100644
> --- a/src/XExtInt.c
> +++ b/src/XExtInt.c
> @@ -1357,6 +1357,7 @@ wireToDeviceEvent(xXIDeviceEvent *in, XGenericEventCookie* cookie)
>      cookie->data = ptr_lib = malloc(len);
>  
>      out = next_block(&ptr_lib, sizeof(XIDeviceEvent));
> +    out->display = cookie->display;
>      out->type = in->type;
>      out->extension = in->extension;
>      out->evtype = in->evtype;
> @@ -1591,6 +1592,7 @@ wireToDeviceChangedEvent(xXIDeviceChangedEvent *in, XGenericEventCookie *cookie)
>      cookie->data = out = malloc(sizeof(XIDeviceChangedEvent) + len);
>  
>      out->type = in->type;
> +    out->display = cookie->display;
>      out->extension = in->extension;
>      out->evtype = in->evtype;
>      out->send_event = ((in->type & 0x80) != 0);
> @@ -1620,6 +1622,7 @@ wireToHierarchyChangedEvent(xXIHierarchyEvent *in, XGenericEventCookie *cookie)
>      cookie->data = out = malloc(sizeof(XIHierarchyEvent) + in->num_info * sizeof(XIHierarchyInfo));;
>  
>      out->info           = (XIHierarchyInfo*)&out[1];
> +    out->display        = cookie->display;
>      out->type           = in->type;
>      out->extension      = in->extension;
>      out->evtype         = in->evtype;
> @@ -1662,6 +1665,7 @@ wireToRawEvent(xXIRawEvent *in, XGenericEventCookie *cookie)
>  
>      out = next_block(&ptr, sizeof(XIRawEvent));
>      out->type           = in->type;
> +    out->display        = cookie->display;
>      out->extension      = in->extension;
>      out->evtype         = in->evtype;
>      out->send_event = ((in->type & 0x80) != 0);
> @@ -1705,6 +1709,7 @@ wireToEnterLeave(xXIEnterEvent *in, XGenericEventCookie *cookie)
>      out->buttons.mask = (unsigned char*)&out[1];
>  
>      out->type           = in->type;
> +    out->display        = cookie->display;
>      out->extension      = in->extension;
>      out->evtype         = in->evtype;
>      out->send_event = ((in->type & 0x80) != 0);
> -- 
> 1.7.2.3

how embarrassing...

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

Cheers,
  Peter


More information about the xorg-devel mailing list