Subject: bug#21415: 25.0.50; Emacs Trunk -- pixelwise width/height for x-create-frame

From: Andy Moreton <[email-masked]>
Date: Sat, 03 Oct 2015 12:28:31 +0100

On Fri 02 Oct 2015, martin rudalics wrote:
> Find attached the most recent version of the patch.  Fixes are mainly
> for Lucid/Motif but something might change for other platforms as well.
>
> @@ -3166,15 +3171,25 @@ x_set_frame_parameters (struct frame *f, Lisp_Object alist)
>        prop = parms[i];
>        val = values[i];
>
> -      if (EQ (prop, Qwidth) && RANGED_INTEGERP (0, val, INT_MAX))
> +      if (EQ (prop, Qwidth))
>          {
>  	  width_change = 1;
> -          width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ;
> +	  if (RANGED_INTEGERP (0, val, INT_MAX))
> +	    width = XFASTINT (val) * FRAME_COLUMN_WIDTH (f) ;
> +	  else if (FLOATP (val)
> +		   && XFLOAT_DATA (val) >= 0
> +		   && (int) XFLOAT_DATA (val) <= INT_MAX)
> +	    width = (int) XFLOAT_DATA (val);
>          }

This changes the logic to set width_change even when Qwidth is an
out of range integer: is that intended ?

> -      else if (EQ (prop, Qheight) && RANGED_INTEGERP (0, val, INT_MAX))
> +      else if (EQ (prop, Qheight))
>          {
>  	  height_change = 1;
> -          height = XFASTINT (val) * FRAME_LINE_HEIGHT (f);
> +	  if (RANGED_INTEGERP (0, val, INT_MAX))
> +	    height = XFASTINT (val) * FRAME_LINE_HEIGHT (f);
> +	  else if (FLOATP (val)
> +		   && XFLOAT_DATA (val) >= 0
> +		   && (int) XFLOAT_DATA (val) <= INT_MAX)
> +	    height = (int) XFLOAT_DATA (val);

Similarly for height_change.

    AndyM