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

From: martin rudalics <[email-masked]>
Date: Sat, 03 Oct 2015 14:31:41 +0200

>> @@ -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 ?

Certainly not.

 >> -      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.

Thanks for the heads-up.  I will fix that.

Did you try the rest of it?  Any suggestions?

martin