[PATCH xwininfo] Work around xcb_translate_coordinates sign bug

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 21 17:18:49 PDT 2010


On Thu, Oct 21, 2010 at 12:59:11PM +0200, Julien Cristau wrote:
> xcb_translate_coordinates_reply_t has unsigned dst_{x,y}, so explicitly
> cast them to int16_t to get the right values.
> Reported on irc by frostwork.
> 
> Signed-off-by: Julien Cristau <jcristau at debian.org>
> ---
>  xwininfo.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/xwininfo.c b/xwininfo.c
> index dfe090d..42a38a0 100644
> --- a/xwininfo.c
> +++ b/xwininfo.c
> @@ -940,8 +940,8 @@ Display_Stats_Info (struct wininfo *w)
>      if (!trans_coords)
>  	Fatal_Error ("Can't get translated coordinates.");
>  
> -    rx = trans_coords->dst_x;
> -    ry = trans_coords->dst_y;
> +    rx = (int16_t)trans_coords->dst_x;
> +    ry = (int16_t)trans_coords->dst_y;
>      free (trans_coords);
>  
>      xright = (dw - rx - w->geometry->border_width * 2 -
> -- 
> 1.7.1

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


More information about the xorg-devel mailing list